From d66b77299d40a8ebcbaec1267222b3a22b063518 Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Sat, 21 Dec 2013 08:44:21 -0800 Subject: [PATCH] weblog --- ...-07-01-wmii-3-1-configuration-in-ruby.html | 1 + 4-reminders-6-paramitas-1-universe.html | 121 ++ 4digit-base36-timestamp.html | 1496 ++++++++++++++++ about.html | 655 +++++++ acer-c720-linux.html | 275 +++ chess-diagrams-in-lyx-with-pdflatex.html | 20 + compiling-jedit-in-ubuntu-linux.html | 32 + compiling-workrave-in-fedora-core-4.html | 23 + contest-rails-testing-monkeypatch.html | 56 + copyleft-mit-license.html | 147 ++ dactyl-manuform-5x6-keyboard.html | 403 +++++ darcs-2-enhances-amend-record.html | 36 + darcs-migration-tailor-ascii-error.html | 15 + defining-methods-for-erb-templates.html | 26 + dwm-spawn-cwd-patch.html | 92 + ebola-virus.html | 91 + educ92a-essay.html | 156 ++ elixir-fileio-speedup.html | 112 ++ elixir-parallel-grep.html | 98 ++ engram-keyboard-layout.html | 445 +++++ engrammer-keyboard-layout.html | 30 + ergohaven-remnant-keyboard.html | 441 +++++ extjs4-mvc-rails31-asset-pipeline.html | 52 + ...acting-archives-without-making-a-mess.html | 242 +++ ftv01-la-jetee-effects.html | 35 + ftv01-the-power-of-film.html | 54 + git-rebase-autocon.html | 112 ++ gruvbox-terminal-color-scheme.html | 105 ++ guiltless-monkeypatching-with-uuid.html | 36 + his29-essay1.html | 180 ++ his29-essay2.html | 152 ++ home-row-mods.html | 459 +++++ hterm-shift-pageup.html | 66 + iex-eval-stdin.html | 118 ++ index.atom | 300 ++++ index.html | 10 + index.js | 70 + jedit-max-width-patch.html | 77 + joe-hisaishi-sheeta-no-ketsui.html | 21 + mac-address-rotation.html | 37 + making-erb-behave-like-php.html | 36 + making-jedit-and-wmii-2-cooperate.html | 21 + masters-thesis-completed.html | 9 + meditation-five-steps.html | 96 + minitest-colordiff.html | 149 ++ moergo-glove80-keyboard-layers.pdf | Bin 1887005 -> 1887007 bytes moergo-glove80-keyboard.html | 1351 ++++++++++++++ musc80v-midterm.html | 110 ++ nanase-hikaru-honoka-na-omoi.html | 25 + one-tab-is-two-spaces.html | 33 + oniguruma-negated-regexps.html | 89 + openag5-typing-microcontroller-pins.html | 49 + ...izing-firefox-bookmarks-with-freemind.html | 34 + papercolor-terminal-color-scheme.html | 88 + rails3-gui-api.html | 64 + revival-of-the-ruby-vpi-project.html | 48 + ruby-1.9.3-p0-power-efficiency.html | 63 + ruby-vpi-c-extension-breakthrough.html | 30 + ruby-vpi-using-ruby-debug.html | 25 + ryuichi-sakamoto-solitude.html | 17 + sencha-architect2-rails31-asset-pipeline.html | 128 ++ slim-tilt-redcarpet.html | 81 + socy15-essay1.html | 51 + socy15-essay2.html | 58 + socy15-essay3.html | 50 + ...laster-audigy-2-value-in-ubuntu-hoary.html | 92 + startx-login-tty1.html | 36 + style.css | 415 +++++ switching-from-fish-to-zsh.html | 61 + switching-from-jedit-to-vim.html | 28 + tamsyn-1.7b-font-review.html | 63 + tamsyn-1.7b-review.html | 1 + telugu-fonts-in-ubuntu-breezy.html | 11 + telugu-rts-with-iiimf.html | 175 ++ telugu-rts-with-scim-demo.html | 17 + telugu-rts-with-scim.html | 75 + telugu-vocabulary.html | 486 ++++++ test-loop.html | 48 + text-formatting-with-smart-crown-margins.html | 61 + the-cult-of-codethulu.html | 55 + the-sixth-sense.html | 118 ++ the-umbrella-of-sacrifice.html | 20 + tmux-24bit-color.html | 620 +++++++ tmux-half-screen-tiling-layouts.html | 17 + tmux-layout-dwindle.html | 321 ++++ tmux-pane-zoom.html | 70 + tmux-refocus-patch.html | 179 ++ tmux-searchable-scrollback.html | 25 + tmux-select-pane.html | 243 +++ tmux-yank-osc52.html | 220 +++ tomorrow-terminal-color-scheme.html | 140 ++ using-telugu-in-ubuntu-linux.html | 143 ++ vegan-for-life.html | 1550 +++++++++++++++++ vim-256color-bce.html | 178 ++ vim-script-management-system.html | 46 + wmii-3.1-ruby-config.html | 271 +++ xfce-enlarge-titlebar-buttons.html | 38 + xoria256-menu-color-patch.html | 24 + xoria256-terminal-color-scheme.html | 142 ++ yaml-json-validation-kwalify-ruby19.html | 87 + zabutom-zeta-force-level-2.html | 161 ++ zenburn-terminal-color-scheme.html | 122 ++ 102 files changed, 15961 insertions(+) create mode 100644 2006-07-01-wmii-3-1-configuration-in-ruby.html create mode 100644 4-reminders-6-paramitas-1-universe.html create mode 100644 4digit-base36-timestamp.html create mode 100644 about.html create mode 100644 acer-c720-linux.html create mode 100644 chess-diagrams-in-lyx-with-pdflatex.html create mode 100644 compiling-jedit-in-ubuntu-linux.html create mode 100644 compiling-workrave-in-fedora-core-4.html create mode 100644 contest-rails-testing-monkeypatch.html create mode 100644 copyleft-mit-license.html create mode 100644 dactyl-manuform-5x6-keyboard.html create mode 100644 darcs-2-enhances-amend-record.html create mode 100644 darcs-migration-tailor-ascii-error.html create mode 100644 defining-methods-for-erb-templates.html create mode 100644 dwm-spawn-cwd-patch.html create mode 100644 ebola-virus.html create mode 100644 educ92a-essay.html create mode 100644 elixir-fileio-speedup.html create mode 100644 elixir-parallel-grep.html create mode 100644 engram-keyboard-layout.html create mode 100644 engrammer-keyboard-layout.html create mode 100644 ergohaven-remnant-keyboard.html create mode 100644 extjs4-mvc-rails31-asset-pipeline.html create mode 100644 extracting-archives-without-making-a-mess.html create mode 100644 ftv01-la-jetee-effects.html create mode 100644 ftv01-the-power-of-film.html create mode 100644 git-rebase-autocon.html create mode 100644 gruvbox-terminal-color-scheme.html create mode 100644 guiltless-monkeypatching-with-uuid.html create mode 100644 his29-essay1.html create mode 100644 his29-essay2.html create mode 100644 home-row-mods.html create mode 100644 hterm-shift-pageup.html create mode 100644 iex-eval-stdin.html create mode 100644 index.atom create mode 100644 index.html create mode 100644 index.js create mode 100644 jedit-max-width-patch.html create mode 100644 joe-hisaishi-sheeta-no-ketsui.html create mode 100644 mac-address-rotation.html create mode 100644 making-erb-behave-like-php.html create mode 100644 making-jedit-and-wmii-2-cooperate.html create mode 100644 masters-thesis-completed.html create mode 100644 meditation-five-steps.html create mode 100644 minitest-colordiff.html create mode 100644 moergo-glove80-keyboard.html create mode 100644 musc80v-midterm.html create mode 100644 nanase-hikaru-honoka-na-omoi.html create mode 100644 one-tab-is-two-spaces.html create mode 100644 oniguruma-negated-regexps.html create mode 100644 openag5-typing-microcontroller-pins.html create mode 100644 organizing-firefox-bookmarks-with-freemind.html create mode 100644 papercolor-terminal-color-scheme.html create mode 100644 rails3-gui-api.html create mode 100644 revival-of-the-ruby-vpi-project.html create mode 100644 ruby-1.9.3-p0-power-efficiency.html create mode 100644 ruby-vpi-c-extension-breakthrough.html create mode 100644 ruby-vpi-using-ruby-debug.html create mode 100644 ryuichi-sakamoto-solitude.html create mode 100644 sencha-architect2-rails31-asset-pipeline.html create mode 100644 slim-tilt-redcarpet.html create mode 100644 socy15-essay1.html create mode 100644 socy15-essay2.html create mode 100644 socy15-essay3.html create mode 100644 soundblaster-audigy-2-value-in-ubuntu-hoary.html create mode 100644 startx-login-tty1.html create mode 100644 style.css create mode 100644 switching-from-fish-to-zsh.html create mode 100644 switching-from-jedit-to-vim.html create mode 100644 tamsyn-1.7b-font-review.html create mode 100644 tamsyn-1.7b-review.html create mode 100644 telugu-fonts-in-ubuntu-breezy.html create mode 100644 telugu-rts-with-iiimf.html create mode 100644 telugu-rts-with-scim-demo.html create mode 100644 telugu-rts-with-scim.html create mode 100644 telugu-vocabulary.html create mode 100644 test-loop.html create mode 100644 text-formatting-with-smart-crown-margins.html create mode 100644 the-cult-of-codethulu.html create mode 100644 the-sixth-sense.html create mode 100644 the-umbrella-of-sacrifice.html create mode 100644 tmux-24bit-color.html create mode 100644 tmux-half-screen-tiling-layouts.html create mode 100644 tmux-layout-dwindle.html create mode 100644 tmux-pane-zoom.html create mode 100644 tmux-refocus-patch.html create mode 100644 tmux-searchable-scrollback.html create mode 100644 tmux-select-pane.html create mode 100644 tmux-yank-osc52.html create mode 100644 tomorrow-terminal-color-scheme.html create mode 100644 using-telugu-in-ubuntu-linux.html create mode 100644 vegan-for-life.html create mode 100644 vim-256color-bce.html create mode 100644 vim-script-management-system.html create mode 100644 wmii-3.1-ruby-config.html create mode 100644 xfce-enlarge-titlebar-buttons.html create mode 100644 xoria256-menu-color-patch.html create mode 100644 xoria256-terminal-color-scheme.html create mode 100644 yaml-json-validation-kwalify-ruby19.html create mode 100644 zabutom-zeta-force-level-2.html create mode 100644 zenburn-terminal-color-scheme.html diff --git a/2006-07-01-wmii-3-1-configuration-in-ruby.html b/2006-07-01-wmii-3-1-configuration-in-ruby.html new file mode 100644 index 0000000..0b308fb --- /dev/null +++ b/2006-07-01-wmii-3-1-configuration-in-ruby.html @@ -0,0 +1 @@ + diff --git a/4-reminders-6-paramitas-1-universe.html b/4-reminders-6-paramitas-1-universe.html new file mode 100644 index 0000000..2aeb335 --- /dev/null +++ b/4-reminders-6-paramitas-1-universe.html @@ -0,0 +1,121 @@ +Four reminders, Six paramitas, and One universe - The Terminal Programmer

Four reminders, Six paramitas, and One universe

Suraj N. Kurapati

  1. Four reminders
    1. Life is precious
      1. Impermanence
        1. Samsara
          1. Karma
          2. Six paramitas
            1. One universe

              Charged with responsibilities, bound by commitments, and consumed by +troubles, all the while racing to meet the incessant march of time, we +often lose sight of what life really is and what is important within it.

              +

              The following videos helped me see the life beyond that race. First, the +four reminders taught me how to distinguish between the life and the +race. Second, the six paramitas taught me how to develop the life +while still staying in the race. Finally, the one universe put the +life, the race, and the self into perspective on the grandest of scales.

              +

              Thus I invite you to watch them (they are short videos: not longer than +ten minutes each) at your convenience if you wish to develop yourself +further while keeping the life, the race, the self, and the universe all +in perspective. :-)

              + +

              Four reminders

              +

              Reminded by Ringu Tulku:

              + +
                +
              1. Life is precious
              2. +
              3. Impermanence
              4. +
              5. Samsara
              6. +
              7. Karma
              8. +
              + +
              +

              Click to watch video

              +
              +

              If we are reminded of these four things, and if we really integrate these four +understandings or change our attitudes along these four ways, that alone can +transform our life: we can each become a more responsible/joyful/understanding +person. Therefore, these four reminders are said to be the first thing we try +to reflect on, if we want to transform ourselves.

              + +

              Life is precious

              +

              How happy/satisfied we are depends on how much we appreciate what we have. +It’s not about the problems that we have, but how much we concentrate on the +problems that makes us unhappy, sad, and depressed. Therefore, one of the main +reminders is that we need to appreciate what we have.

              +

              That is the first principle to transform our life. And if we really work on +this, this alone can also transform our way of feeling.

              + +

              Impermanence

              +

              Everything changes: there’s nothing that doesn’t change. Good times can +change, but bad times can also change. So even when I go through the most +difficult times, I need to remind myself that there’s nothing which doesn’t +change.

              +

              Everything changes: that’s the nature of the life/phenomenon. The more we see +this clearly, the more we know that nothing really exists… in the same +way all the time, and the more we can let things be.

              +

              And we also understand that life is change: if there’s no change, there’s +no life/development/living. Therefore, we need to let things happen: +there’s no use holding on too much to either negative/bad/hurtful things +that happened to us or good/positive things that might be with us sometimes.

              +

              If we really understand this deeply (the impermanence: that everything is +changing) and really integrate it with our life, this could also transform our +life. That’s the second reminder.

              + +

              Samsara

              +

              Samsara means that all of us, human beings, have weaknesses/problems and we +need to understand that nobody is perfect. There’s lots of +pain/suffering/problems around us in the world. When we understand that +deeply, we don’t need to expect everything to be perfect.

              +

              The more we understand that, the more we appreciate the little good things +that people do for us: if we find someone being a little nicer/kinder, we can +appreciate it more because we know that people can be mean, have problems, +and carry lots of negative feelings. So the more we understand these +weaknesses (the Samsaric state of mind: that there are the +problems/pain/weaknesses in people), the more we can understand how to +appreciate the positive things.

              +

              Also, if people do negative things, we can still be compassionate/forgiving +to them because of the Samsaric way of being we all have (with all the +negative emotions/ignorance/selfishness). We all have +greed/aggression/ignorance and that allow us to feel more compassionate to +people, even those who are doing not-so-positive things.

              +

              The more we understand Samsara, the more we feel at ease living with other +people because we don’t expect too much from everybody and also because we +don’t expect too much from ourselves. This is the third reminder.

              + +

              Karma

              +

              Everything has causes/conditions and happens interdependently/relatively: what +I am now is because of my past and what I will be in the future is because of +my present so my future is, in a way, in my hands. Therefore, I have to +take responsibility for myself and think/act in a proper/careful way because +how I act with my body, speech, and mind is very important not only for my +own future but also because it affects the world/people around me.

              + +

              Six paramitas

              +

              Explained by Ringu Tulku:

              + +
                +
              1. Giving
              2. +
              3. Conduct
              4. +
              5. Patience
              6. +
              7. Diligence
              8. +
              9. Meditation
              10. +
              11. Wisdom
              12. +
              + +
              +

              Click to watch video

              +
              + +

              One universe

              + +
              +

              Click to watch video

              +
              +

               

              + +
              +

              Click to watch video

              +
              +

               

              + +
              +

              Click to watch video

              +
              +

              \ No newline at end of file diff --git a/4digit-base36-timestamp.html b/4digit-base36-timestamp.html new file mode 100644 index 0000000..c5a5f89 --- /dev/null +++ b/4digit-base36-timestamp.html @@ -0,0 +1,1496 @@ +Encoding four base 36 digits as a timestamp - The Terminal Programmer

              Encoding four base 36 digits as a timestamp

              Suraj N. Kurapati


              1. Problem
                1. Approach
                  1. Solution
                    1. Evaluation
                      1. Comparison
                        1. Behind the scenes
                          1. comparison.rb
                          +

                          Problem

                          +

                          Convert a string containing 4 uppercase alphanumeric characters, whose +values range from A through Z and 0 through 9, into a “HH:MM:SS” +(24 hours, 60 minutes, 60 seconds) timestamp whose value ranges from +“00:00:00” through “23:59:59”.

                          +

                          The string has 1679616 possible values (36 × 36 × 36 × +36) whereas the timestamp has 86400 possible values (24 × 60 × +60). Thus the challenge is to convey more information using less.

                          +

                          How would you solve this problem? Pause for a moment to think about it. +In fact, go now and implement your solution before reading about my +particular approach and solution below, as this is quite a fun puzzle! :)

                          + +

                          Approach

                          +

                          Each character in the input string can be represented as a base 36 digit:

                          + +
                            +
                          • Characters 0 through 9 become integers 0 through 9 respectively.
                          • +
                          • Characters A through Z become integers 10 through 35 respectively.
                          • +
                          +

                          Let’s examine the base 36 and binary representations of each character:

                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          CharacterBase 36Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1
                          00.....0
                          11.....1
                          22....10
                          33....11
                          44...100
                          55...101
                          66...110
                          77...111
                          88..1000
                          99..1001
                          A10..1010
                          B11..1011
                          C12..1100
                          D13..1101
                          E14..1110
                          F15..1111
                          G16.10000
                          H17.10001
                          I18.10010
                          J19.10011
                          K20.10100
                          L21.10101
                          M22.10110
                          N23.10111
                          O24.11000
                          P25.11001
                          Q26.11010
                          R27.11011
                          S28.11100
                          T29.11101
                          U30.11110
                          V31.11111
                          W32100000
                          X33100001
                          Y34100010
                          Z35100011
                          +

                          Notice that bit 6 is present in only 4 characters, W through Z, and +absent in all others. Thus, if we randomly picked a character from the +set of 36 possible characters, the probability of finding bit 6 in our +pick is 4 ÷ 36, or 0.1111111111111111, which approximately denotes a +11% chance of success.

                          +

                          In contrast, notice that bit 1 is present in every character. Thus, if +we randomly picked a character from the set of 36 possible characters, the +probability of finding bit 1 in our pick is 36 ÷ 36, or 1, which +denotes a 100% chance of success.

                          +

                          These facts are recorded in the table below.

                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          BitNumber of characters present inProbability of presence
                          640.1111111111111111
                          5200.5555555555555556
                          4280.7777777777777778
                          3320.8888888888888888
                          2340.9444444444444444
                          1361
                          +

                          The timestamp, with its 86400 possible values, cannot represent all +1679616 values possible in the string unless we reuse some of them. That +is, instead of mapping each unique string value to exactly one unique +timestamp value, we map multiple unique string values to the same +unique timestamp value, thereby reusing it.

                          +

                          This reuse happens automatically when we discard information. For example, +if we discard the fourth character from two different strings “ABCD” and +“ABCX”, then they would both become “ABC”. Next, if the string “ABC” were +mapped to the timestamp “01:02:03”, then both strings “ABCD” and “ABCX” +would map to the same “01:02:03” timestamp, thereby achieving reuse.

                          +

                          We can discard information strategically based on the probabilities +listed in the table above. In particular, we can discard bits with lower +presence probabilities with less risk of information loss because +discarding nonexistent bits from a value does not change it. For example, +bit 6 is present 11% of the time, so we only risk information loss 11% of +the time by discarding it. In contrast, bit 1 is present 100% of the time, +so we risk information loss 100% of the time by discarding it.

                          +

                          In binary, the string occupies 24 bits (4 characters × 6 bits per +character) and the timestamp occupies at least 16 bits (216 < 86400 +possible values < 217). Therefore, we need to discard at least 8 bits +(24 string bits - 16 timestamp bits) of information from the string to fit +it within the timestamp’s 16 bits. This translates to 2 bits (8 bits +discarded ÷ 4 characters) discarded per character.

                          +

                          Since lower bits are more likely to be present than higher ones, as the +table above shows, we should keep as many lower bits as possible and +discard as few higher bits as necessary. Thus, we shall discard the upper +2 bits (bit 6 and 5) from each character in the string to fit the string +within the timestamp.

                          + +

                          Solution

                          +

                          In the Ruby programming language:

                          +
                          
                          +# Converts the given string into a "HH:MM:SS" timestamp.
                          +def solution(string)
                          +  digits = digits36(string)
                          +  num_seconds = compress(*digits)
                          +  Time.at(num_seconds).utc.strftime('%H:%M:%S')
                          +end
                          +
                          +# Converts each character in the given string into a base 36 digit.
                          +def digits36(string)
                          +  string.each_char.map { |char| digit36(char) }
                          +end
                          +
                          +# Converts the given character into a base 36 digit:
                          +# decimal digits (0..9) + uppercase letters (10..35)
                          +def digit36(char)
                          +  case char
                          +  when '0'..'9' then char.ord - '0'.ord
                          +  when 'A'..'Z' then char.ord - 'A'.ord + 10
                          +  else raise ArgumentError, "not a base36 digit: #{char.inspect}"
                          +  end
                          +end
                          +
                          +# Combines the given base 36 digits together into a 16-bit integer.
                          +SECONDS_PER_DAY = 24 * 60 * 60 # hours * minutes/hour * seconds/minute
                          +SECONDS_PER_DAY_BITS = Math.log2(SECONDS_PER_DAY).ceil # 2 ** exponent
                          +def compress(*chars)
                          +  return 0 if chars.empty?
                          +  bits = SECONDS_PER_DAY_BITS / chars.length
                          +  mask = (1 << bits) - 1
                          +  chars.inject(0) do |acc, char|
                          +    # grab lower bits from each character and place them side by side
                          +    (acc << bits) | (char & mask)
                          +  end % SECONDS_PER_DAY
                          +end
                          +
                          +

                          Save the above code to a solution.rb file to play with it:

                          +
                          
                          +$ irb --simple-prompt -r ./solution.rb
                          +## ruby 2.1.2p95 (2014-05-08) [x86_64-linux-gnu]
                          +
                          +>> solution "ABCD"
                          +"12:13:01"
                          +
                          +>> digits36 "ABCD"
                          +[10, 11, 12, 13]
                          +
                          +>> compress 10, 11, 12, 13
                          +43981
                          +
                          +>> Time.at(43981).utc
                          +1970-01-01 12:13:01 UTC
                          +
                          +

                          The solution above is generic to any number of characters, so try more:

                          +
                          
                          +$ irb --simple-prompt -r ./solution.rb
                          +## ruby 2.1.2p95 (2014-05-08) [x86_64-linux-gnu]
                          +
                          +>> solution "ABCDEFG"
                          +"03:09:32"
                          +
                          +>> digits36 "ABCDEFG"
                          +[10, 11, 12, 13, 14, 15, 16]
                          +
                          +>> compress 10, 11, 12, 13, 14, 15, 16
                          +11372
                          +
                          +>> Time.at(11372).utc
                          +1970-01-01 03:09:32 UTC
                          +
                          +
                          +

                          Evaluation

                          +

                          To evaluate how well the algorithm performs, we feed it different sets of +input strings and analyze its output: the more input strings it maps to +unique timestamps, the smaller the reuse probability and the better it is.

                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          Algorithm (f : string → timestamp) characteristicsBest caseWorst caseNo case
                          Number of strings (domain)655361600001679616
                          Number of timestamps (codomain)655366553665536
                          Number of unique timestamps65536207360
                          Number of timestamps reused04480065536
                          Probability of timestamp reuse00.683593751
                          Number of strings mapped to reused timestamps01392641679616
                          Probability of string mapped to reused timestamp00.87041
                          +

                          In the best case, where all input characters fed into the algorithm lack +the upper bits it discards, information is never lost. Therefore, the +probability of timestamp reuse is zero.

                          +

                          In the worst case, where all input characters fed into the algorithm +contain the upper bits it discards, some information is always lost. +Therefore, the probability of timestamp reuse is greater than zero.

                          +

                          In the “no” case, where some input characters fed into the algorithm +contain the upper bits it discards, information is sometimes lost. +However, since this input set contains all 1679616 possible input +strings, timestamps will always be reused: the timestamp, with its 86400 +possible values, cannot represent all 1679616 values possible in the +string unless we reuse some of them.

                          +

                          This observation applies to any such algorithm.

                          + +

                          Comparison

                          +

                          My solution to this problem is based on probabilities. However, there are +many other solutions, some of which are known as hash functions. +Let’s compare them, along with my solution, to see how well they perform.

                          +

                          To compare these algorithms fairly, we need to feed them the same set of +strings. Unlike the singular evaluation of my solution above, here we +don’t have the luxury of partitioning the input space into best and worst +cases up front, because such cases vary wildly across these algorithms.

                          +

                          Here, I have chosen to feed all 4-subsets of the 36 possible uppercase +alphanumeric characters, which produces 58905 unique strings containing +4 unique uppercase alphanumeric characters each, into these algorithms. +Although this choice poorly approximates reality, wherein strings may +contain repeated characters, some such sacrifice is necessary to produce +a non-exhaustive set of inputs with which to compare these algorithms.

                          +

                          The results are recorded in the table below, sorted by reuse probabilities +in ascending order: from the best result first to the worst result last.

                          +

                          The key result to notice here is that my solution had the +best performance among all of these algorithms. I was delighted to see +this because I expected it fare far worse than real algorithms. :-)

                          +

                          One surprising result is that the ∅ solution, which simply discards +the fourth character and doesn’t bother with any of this algorithmic +nonsense, performs better than half of these algorithms. Although its +performance isn’t praiseworthy, it nevertheless hints that perhaps, +sometimes, ignoring a problem can be just as effective as solving it.

                          +

                          Augh! What am I saying? Those are not the words of a true engineer! +Problems must always be solved and solved well, so long as it’s fun. ;-) +Anyway, that’s all folks. I hope you enjoyed this algorithmic treatise. +But wait! Don’t leave just yet because there are some fun behind the +scenes goodies waiting for you below! :-)

                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          Algorithm (f : string → timestamp)Number of strings (domain)Number of timestamps (codomain)Number of unique timestampsNumber of timestamps reusedProbability of timestamp reuseNumber of strings mapped to reused timestampsProbability of string mapped to reused timestamp
                          My solution58905395313469048410.12246085350737396242150.411085646379764
                          Preserve bits 4,3,2,158905395313469048410.12246085350737396242150.411085646379764
                          Rotating hash58905429363464982870.193008198248556242560.4117816823699177
                          Bernstein XOR hash589054671835673110450.23641851106639838232320.39439775910364144
                          Shift-Add-XOR hash589054462332440121830.2730206395804854264650.4492827434003905
                          Preserve bits 4,3,2,1 then add bits 6,5589054065129341113100.2782219379597058295640.5018928783634666
                          Bernstein hash589054328128707145740.33672974284327994301980.5126559714795009
                          djb2 hash589054328128707145740.33672974284327994301980.5126559714795009
                          Pearson hash589053883823805150330.3870693650548432351000.5958747135217723
                          FNV-1a hash589053622521085151400.4179434092477571378200.6420507596978186
                          FNV-1 hash589053533820229151090.42755673778934855386760.6565826330532213
                          Preserve bits 4,3,2,1 then XOR bits 6,5589052900315230137730.47488190876805847436750.7414480943892708
                          Preserve bits 5,3,2,158905212436706145370.6843195405545356521990.8861556743909685
                          Exim nhash589057401128061210.8270503985947845576250.9782700959171547
                          Merge fourth character into others589059467147779900.8439843667476498574280.9749257278669043
                          Fletcher16 checksum58905493562143140.8741641337386018582840.9894576012223071
                          Preserve bits 5,4,2,158905129311610113210.8754930013146702572950.9726678550207962
                          sdbm hash58905334333130120.9009871373018247585740.9943807826160768
                          Discard fourth character (∅ solution)58905654556159840.9142857142857143583440.9904761904761905
                          Preserve bits 6,3,2,158905656133162300.9495503734186862585740.9943807826160768
                          Preserve bits 5,4,3,158905719132768640.9545264914476429585780.9944486885663356
                          BSD checksum58905464214430.9547413793103449588840.9996434937611408
                          LRC checksum5890512941250.9689922480620154589010.9999320940497411
                          lose lose hash5890512941250.9689922480620154589010.9999320940497411
                          Preserve bits 6,4,2,158905614517159740.9721724979658258587340.9970970206264324
                          Preserve bits 6,5,2,15890526257125540.9729523809523809588340.9987946693829047
                          Preserve bits 5,4,3,258905565515055050.9734748010610079587550.9974535268652915
                          Preserve bits 6,5,3,15890519533919140.9800307219662059588660.9993379169849758
                          Preserve bits 6,5,4,15890510732110520.9804287045666356588840.9996434937611408
                          Preserve bits 6,5,4,35890549594860.9818181818181818588960.9998472116119175
                          Preserve bits 6,4,3,15890541937541180.9821130455521107588300.9987267634326458
                          Jenkins one-at-a-time hash58905958212794550.9867459820496765587780.9978439860792802
                          Preserve bits 6,5,4,2589051005139920.9870646766169154588920.9997793056616586
                          Preserve bits 6,5,3,25890517492117280.9879931389365352588840.9996434937611408
                          Preserve bits 6,4,3,25890536213735840.9897818282242474588680.9993718699601053
                          + +

                          Behind the scenes

                          +

                          I created the giant data table you see above, which +compares different algorithms, by first running the comparison +script and then formatting its results into a nice data +table:

                          +
                          $ ruby -r ./comparison.rb -r pp -e 'pp Comparator.compare Input.combinations' > comparison.txt
                          +
                          +$ vim comparison.txt # do some post-processing to format the results into a nice data table
                          +

                          Similarly, I created the smaller data table you saw above, +which compares the best, worst, and “no” case performance of my +solution, by running these commands:

                          +
                          
                          +# BEST CASE
                          +
                          +$ ruby -r ./comparison.rb -r pp -e 'pp Comparator.compare Input.best_case, /^preserve_lower_bits$/'
                          +[{"Compression algorithm"=>:preserve_lower_bits,
                          +  "Number of strings (domain)"=>65536,
                          +  "Number of timestamps (codomain)"=>65536,
                          +  "Number of unique timestamps"=>65536,
                          +  "Number of timestamps reused"=>0,
                          +  "Probability of timestamp reuse"=>0.0,
                          +  "Number of strings mapped to reused timestamps"=>0,
                          +  "Probability of string mapped to reused timestamp"=>0.0}]
                          +
                          +# WORST CASE
                          +
                          +$ ruby -r ./comparison.rb -r pp -e 'pp Comparator.compare Input.worst_case, /^preserve_lower_bits$/'
                          +[{"Compression algorithm"=>:preserve_lower_bits,
                          +  "Number of strings (domain)"=>160000,
                          +  "Number of timestamps (codomain)"=>65536,
                          +  "Number of unique timestamps"=>20736,
                          +  "Number of timestamps reused"=>44800,
                          +  "Probability of timestamp reuse"=>0.68359375,
                          +  "Number of strings mapped to reused timestamps"=>139264,
                          +  "Probability of string mapped to reused timestamp"=>0.8704}]
                          +
                          +# NO CASE
                          +
                          +$ ruby -r ./comparison.rb -r pp -e 'pp Comparator.compare Input.no_case, /^preserve_lower_bits$/'
                          +[{"Compression algorithm"=>:preserve_lower_bits,
                          +  "Number of strings (domain)"=>1679616,
                          +  "Number of timestamps (codomain)"=>65536,
                          +  "Number of unique timestamps"=>0,
                          +  "Number of timestamps reused"=>65536,
                          +  "Probability of timestamp reuse"=>1.0,
                          +  "Number of strings mapped to reused timestamps"=>1679616,
                          +  "Probability of string mapped to reused timestamp"=>1.0}]
                          +
                          +

                          You can load the comparison script into an interactive +Ruby shell and play with the algorithms and comparisons dynamically:

                          +
                          $ irb --simple-prompt -r ./comparison.rb
                          +## ruby 2.1.2p95 (2014-05-08) [x86_64-linux-gnu]
                          +
                          +>> Input.singleton_methods
                          +[:combinations, :permutations, :best_case, :worst_case, :no_case]
                          +
                          +>> Input.combinations
                          +#<Enumerator: ...>
                          +
                          +>> Input.combinations.take(3)
                          +[["0", "1", "2", "3"], ["0", "1", "2", "4"], ["0", "1", "2", "5"]]
                          +
                          +>> Input.permutations.take(3)
                          +[["0", "0", "0", "0"], ["0", "0", "0", "1"], ["0", "0", "0", "2"]]
                          +
                          +>> Input.best_case.take(3)
                          +[["0", "0", "0", "0"], ["0", "0", "0", "1"], ["0", "0", "0", "2"]]
                          +
                          +>> Input.worst_case.take(3)
                          +[["G", "G", "G", "G"], ["G", "G", "G", "H"], ["G", "G", "G", "I"]]
                          +
                          +>> Input.no_case.take(3)
                          +[["0", "0", "0", "0"], ["0", "0", "0", "1"], ["0", "0", "0", "2"]]
                          +

                          You can even define a new algorithm and measure its performance:

                          +
                          >> def Compressor.my_new_solution(a, b, c, d)
                          +>>   a + b - c * d
                          +>> end
                          +:my_new_solution
                          +
                          +>> Comparator.measure Input.combinations, :my_new_solution
                          +{"Compression algorithm"=>:my_new_solution,
                          + "Number of strings (domain)"=>58905,
                          + "Number of timestamps (codomain)"=>1183,
                          + "Number of unique timestamps"=>7,
                          + "Number of timestamps reused"=>1176,
                          + "Probability of timestamp reuse"=>0.9940828402366864,
                          + "Number of strings mapped to reused timestamps"=>58898,
                          + "Probability of string mapped to reused timestamp"=>0.9998811645870469}
                          +

                          You can also compare it to other algorithms, just as this article did:

                          +
                          >> Comparator.compare Input.combinations
                          +# ... too much output, so it's omitted ...
                          +

                          If that’s too much, selectively compare just the algorithms you want:

                          +
                          >> Comparator.compare Input.combinations, /my_new|char/
                          +[{"Compression algorithm"=>:merge_fourth_char_into_others,
                          +  "Number of strings (domain)"=>58905,
                          +  "Number of timestamps (codomain)"=>9936,
                          +  "Number of unique timestamps"=>1841,
                          +  "Number of timestamps reused"=>8095,
                          +  "Probability of timestamp reuse"=>0.8147141706924316,
                          +  "Number of strings mapped to reused timestamps"=>57064,
                          +  "Probability of string mapped to reused timestamp"=>0.9687462863933453},
                          + {"Compression algorithm"=>:discard_fourth_char,
                          +  "Number of strings (domain)"=>58905,
                          +  "Number of timestamps (codomain)"=>6545,
                          +  "Number of unique timestamps"=>561,
                          +  "Number of timestamps reused"=>5984,
                          +  "Probability of timestamp reuse"=>0.9142857142857143,
                          +  "Number of strings mapped to reused timestamps"=>58344,
                          +  "Probability of string mapped to reused timestamp"=>0.9904761904761905},
                          + {"Compression algorithm"=>:my_new_solution,
                          +  "Number of strings (domain)"=>58905,
                          +  "Number of timestamps (codomain)"=>1183,
                          +  "Number of unique timestamps"=>7,
                          +  "Number of timestamps reused"=>1176,
                          +  "Probability of timestamp reuse"=>0.9940828402366864,
                          +  "Number of strings mapped to reused timestamps"=>58898,
                          +  "Probability of string mapped to reused timestamp"=>0.9998811645870469}]
                          +
                          +

                          comparison.rb

                          +

                          In the Ruby programming language:

                          +
                          
                          +# Combines the given base 36 digits together into a 16-bit integer.
                          +module Compressor
                          +  extend self
                          +
                          +  #              _ _             _       _   _
                          +  #  _ __  _   _| | |  ___  ___ | |_   _| |_(_) ___  _ __
                          +  # | '_ \| | | | | | / __|/ _ \| | | | | __| |/ _ \| '_ \
                          +  # | | | | |_| | | | \__ \ (_) | | |_| | |_| | (_) | | | |
                          +  # |_| |_|\__,_|_|_| |___/\___/|_|\__,_|\__|_|\___/|_| |_|
                          +  #
                          +
                          +  # Why bother with all of this? Just discard the fourth character.
                          +  def discard_fourth_char(a, b, c, d)
                          +    (a * (36 ** 2)) + (b * 36) + c
                          +  end
                          +
                          +  #                              _       _   _
                          +  #  _ __ ___  _   _   ___  ___ | |_   _| |_(_) ___  _ __  ___
                          +  # | '_ ` _ \| | | | / __|/ _ \| | | | | __| |/ _ \| '_ \/ __|
                          +  # | | | | | | |_| | \__ \ (_) | | |_| | |_| | (_) | | | \__ \
                          +  # |_| |_| |_|\__, | |___/\___/|_|\__,_|\__|_|\___/|_| |_|___/
                          +  #            |___/
                          +
                          +  def merge_fourth_char_into_others(a, b, c, d)
                          +    c += (d & 0b11)
                          +    b += (d & 0b1100) >> 2
                          +    a += (d & 0b110000) >> 4
                          +    (a * (36 ** 2)) + (b * 36) + c
                          +  end
                          +
                          +  # This is the solution described in this article.  (((THE WINNER!)))
                          +  def preserve_lower_bits(a, b, c, d)
                          +    upper_byte = ((a & 0xF) << 4) | (b & 0xF)
                          +    lower_byte = ((c & 0xF) << 4) | (d & 0xF)
                          +    (upper_byte << 8) | lower_byte
                          +  end
                          +
                          +  # Generate preserve_bits_WXYZ() functions that try all combinations.
                          +  preserve_bits_helper = lambda do |a, b, c, d, bits|
                          +    fetch_bits = lambda do |char|
                          +      bits.each_with_index.map do |bit, index|
                          +        char[bit] << index
                          +      end.reduce(:|).to_i
                          +    end
                          +    upper_byte = (fetch_bits.(a) << 4) | fetch_bits.(b)
                          +    lower_byte = (fetch_bits.(c) << 4) | fetch_bits.(d)
                          +    ((upper_byte << 8) | lower_byte)
                          +  end
                          +  (0..5).to_a.combination(4).each do |bits|
                          +    define_method "preserve_bits_#{bits.sort.reverse.map(&:next).join}" do
                          +      |a, b, c, d| preserve_bits_helper.(a, b, c, d, bits)
                          +    end
                          +  end
                          +
                          +  def preserve_lower_bits_then_add_upper_bits(a, b, c, d)
                          +    lower_bits = lambda {|char| (char & 0b001111) }
                          +    upper_bits = lambda {|char| (char & 0b110000) >> 4 }
                          +    upper_byte = (lower_bits.(a) << 4) | lower_bits.(c)
                          +    lower_byte = (lower_bits.(b) << 4) | lower_bits.(d)
                          +    extra_byte = (upper_bits.(a) << 6) | (upper_bits.(c) << 4) |
                          +                 (upper_bits.(b) << 2) | (upper_bits.(d) << 0)
                          +    ((upper_byte << 8) | lower_byte) + extra_byte
                          +  end
                          +
                          +  def preserve_lower_bits_then_xor_upper_bits(a, b, c, d)
                          +    lower_bits = lambda {|char| (char & 0b001111) }
                          +    upper_bits = lambda {|char| (char & 0b110000) >> 4 }
                          +    xor_helper = lambda do |char|
                          +      ((upper_bits.(char) ^ (lower_bits.(char) >> 2)) << 2) |
                          +       (lower_bits.(char) & 0b11)
                          +    end
                          +    upper_byte = (xor_helper.(a) << 4) | xor_helper.(c)
                          +    lower_byte = (xor_helper.(b) << 4) | xor_helper.(d)
                          +    ((upper_byte << 8) | lower_byte)
                          +  end
                          +
                          +  #                 _             _       _   _
                          +  #  _ __ ___  __ _| |  ___  ___ | |_   _| |_(_) ___  _ __  ___
                          +  # | '__/ _ \/ _` | | / __|/ _ \| | | | | __| |/ _ \| '_ \/ __|
                          +  # | | |  __/ (_| | | \__ \ (_) | | |_| | |_| | (_) | | | \__ \
                          +  # |_|  \___|\__,_|_| |___/\___/|_|\__,_|\__|_|\___/|_| |_|___/
                          +  #
                          +
                          +  # https://en.wikipedia.org/wiki/Pearson_hashing
                          +  PEARSON_TABLE = ( 0 ... 2**16 ).to_a.shuffle
                          +  def pearson_hash(a, b, c, d)
                          +    hash = 0
                          +    [a, b, c, d].each do |char|
                          +      index = hash ^ char
                          +      hash = PEARSON_TABLE[index]
                          +    end
                          +    hash
                          +  end
                          +
                          +  # http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
                          +  def rotating_hash(a, b, c, d)
                          +    hash = 0
                          +    [a, b, c, d].each do |char|
                          +      hash = (hash << 4) ^ (hash >> 28) ^ char
                          +    end
                          +    hash
                          +  end
                          +
                          +  # http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
                          +  def bernstein_hash(a, b, c, d)
                          +    hash = 0
                          +    [a, b, c, d].each do |char|
                          +      hash = 33 * hash + char
                          +    end
                          +    hash
                          +  end
                          +
                          +  # http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
                          +  def bernstein_xor_hash(a, b, c, d)
                          +    hash = 0
                          +    [a, b, c, d].each do |char|
                          +      hash = 33 * hash ^ char
                          +    end
                          +    hash
                          +  end
                          +
                          +  # http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
                          +  def shift_add_xor_hash(a, b, c, d)
                          +    hash = 0
                          +    [a, b, c, d].each do |char|
                          +      hash ^= (hash << 5) + (hash >> 2) + char
                          +    end
                          +    hash
                          +  end
                          +
                          +  # http://www.isthe.com/chongo/tech/comp/fnv/#FNV-1
                          +  def fnv1_hash(a, b, c, d)
                          +    hash = 2166136261
                          +    [a, b, c, d].each do |char|
                          +      hash = (hash * 16777619) ^ char
                          +    end
                          +    hash
                          +  end
                          +
                          +  # http://www.isthe.com/chongo/tech/comp/fnv/#FNV-1a
                          +  def fnv1a_hash(a, b, c, d)
                          +    hash = 2166136261
                          +    [a, b, c, d].each do |char|
                          +      hash = (hash ^ char) * 16777619
                          +    end
                          +    hash
                          +  end
                          +
                          +  # https://en.wikipedia.org/wiki/Jenkins_hash_function
                          +  def jenkins_one_at_a_time_hash(a, b, c, d)
                          +    hash = 0
                          +    [a, b, c, d].each do |char|
                          +      hash += char
                          +      hash += (hash << 10)
                          +      hash ^= (hash >> 6)
                          +    end
                          +    hash += (hash << 3)
                          +    hash ^= (hash >> 11)
                          +    hash += (hash << 15)
                          +    hash
                          +  end
                          +
                          +  # Algorithm::Nhash - Exim nhash algorithm
                          +  # http://cpansearch.perl.org/src/MOOLI/Algorithm-Nhash-0.002/lib/Algorithm/Nhash.pm
                          +  NHASH_PRIMES = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
                          +                  61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113]
                          +  def exim_nhash(a, b, c, d)
                          +    sum = 0
                          +    i = 0
                          +    [a, b, c, d].each do |char|
                          +      i += 28
                          +      i %= 29
                          +      sum += NHASH_PRIMES[i] * char
                          +    end
                          +    sum
                          +  end
                          +
                          +  # https://en.wikipedia.org/wiki/Fletcher%27s_checksum
                          +  def fletcher16_checksum(a, b, c, d)
                          +    sum1 = 0
                          +    sum2 = 0
                          +
                          +    [a, b, c, d].each do |char|
                          +      sum1 = (sum1 + char) % 255
                          +      sum2 = (sum2 + sum1) % 255
                          +    end
                          +
                          +    (sum2 << 8) | sum1
                          +  end
                          +
                          +  # https://en.wikipedia.org/wiki/BSD_checksum
                          +  def bsd_checksum(a, b, c, d)
                          +    checksum = 0                 # The checksum mod 2^16.
                          +    [a, b, c, d].each do |char|
                          +      checksum = (checksum >> 1) + ((checksum & 1) << 15)
                          +      checksum += char
                          +      checksum &= 0xffff         # Keep it within bounds.
                          +    end
                          +    checksum
                          +  end
                          +
                          +  # https://en.wikipedia.org/wiki/Longitudinal_redundancy_check
                          +  def lrc_checksum(a, b, c, d)
                          +    lrc = 0
                          +    [a, b, c, d].each do |char|
                          +      lrc = (lrc + char) & 0xFF
                          +    end
                          +    lrc = (((lrc ^ 0xFF) + 1) & 0xFF)
                          +  end
                          +
                          +  # http://www.cse.yorku.ca/~oz/hash.html
                          +  def djb2_hash(a, b, c, d)
                          +    hash = 5381
                          +    [a, b, c, d].each do |char|
                          +      hash = ((hash << 5) + hash) + char # hash * 33 + c
                          +    end
                          +    hash
                          +  end
                          +
                          +  # http://www.cse.yorku.ca/~oz/hash.html
                          +  def sdbm_hash(a, b, c, d)
                          +    hash = 0
                          +    [a, b, c, d].each do |char|
                          +      hash = char + (hash << 6) + (hash << 16) - hash
                          +    end
                          +    hash
                          +  end
                          +
                          +  # http://www.cse.yorku.ca/~oz/hash.html
                          +  def lose_lose_hash(a, b, c, d)
                          +    hash = 0
                          +    [a, b, c, d].each do |char|
                          +      hash += char
                          +    end
                          +    hash
                          +  end
                          +
                          +end
                          +
                          +module Solver
                          +  extend self
                          +
                          +  # Converts the given 4-character string into a "HH:MM:SS" timestamp.
                          +  def solution(string, compressor)
                          +    a, b, c, d  = digits36(string)
                          +    num_seconds = Compressor.send(compressor, a, b, c, d)
                          +    Time.at(num_seconds).strftime('%H:%M:%S')
                          +  end
                          +
                          +  # Converts each character in the given string into a base 36 digits.
                          +  def digits36(string)
                          +    string.each_char.map { |char| digit36(char) }
                          +  end
                          +
                          +  # Converts the given character into a base 36 digit:
                          +  # decimal digits (0..9) + uppercase letters (10..35)
                          +  def digit36(char)
                          +    case char
                          +    when '0'..'9' then char.ord - '0'.ord
                          +    when 'A'..'Z' then char.ord - 'A'.ord + 10
                          +    else -1
                          +    end
                          +  end
                          +
                          +  # Converts the given base 36 digit into a character.
                          +  def undigit36(code)
                          +    case code
                          +    when  0..9  then ('0'.ord + code).chr
                          +    when 10..35 then ('A'.ord + (code - 10)).chr
                          +    else '?'
                          +    end
                          +  end
                          +
                          +end
                          +
                          +module Input
                          +  extend self
                          +
                          +  DOMAIN = ('0'..'9').to_a + ('A'..'Z').to_a
                          +
                          +  def combinations
                          +    DOMAIN.combination(4)
                          +  end
                          +
                          +  def permutations(domain=DOMAIN)
                          +    if block_given?
                          +      domain.each do |a|
                          +        domain.each do |b|
                          +          domain.each do |c|
                          +            domain.each do |d|
                          +              yield [a, b, c, d]
                          +            end
                          +          end
                          +        end
                          +      end
                          +    else
                          +      enum_for __method__, domain
                          +    end
                          +  end
                          +
                          +  def best_case
                          +    permutations DOMAIN[0..15]
                          +  end
                          +
                          +  def worst_case
                          +    permutations DOMAIN[16..35]
                          +  end
                          +
                          +  alias no_case permutations
                          +
                          +end
                          +
                          +module Comparator
                          +  extend self
                          +
                          +  # Compares the fitness of all compressors that match the given regexp.
                          +  def compare(inputs, compressor_regexp=//)
                          +    Compressor.singleton_methods.grep(compressor_regexp).
                          +      map { |compressor| measure(inputs, compressor) }.
                          +      sort_by { |measurement| measurement['Probability of timestamp reuse'] }
                          +  end
                          +
                          +  # Measures the fitness of the given compressor.
                          +  def measure(inputs, compressor)
                          +    reuse_by_timestamp = measure_reuse(inputs, compressor)
                          +
                          +    num_keys = reuse_by_timestamp.count
                          +    num_values = reuse_by_timestamp.values.reduce(:+).to_i
                          +
                          +    actual_reuse = reuse_by_timestamp.select {|k,v| v > 1 }
                          +    num_keys_reused = actual_reuse.count
                          +    num_values_reused = actual_reuse.values.reduce(:+).to_i
                          +
                          +    {
                          +      'Compression algorithm'                            => compressor,
                          +      'Number of strings (domain)'                       => num_values,
                          +      'Number of timestamps (codomain)'                  => num_keys,
                          +      'Number of unique timestamps'                      => num_keys - num_keys_reused,
                          +      'Number of timestamps reused'                      => num_keys_reused,
                          +      'Probability of timestamp reuse'                   => num_keys_reused / num_keys.to_f,
                          +      'Number of strings mapped to reused timestamps'    => num_values_reused,
                          +      'Probability of string mapped to reused timestamp' => num_values_reused / num_values.to_f,
                          +    }
                          +  end
                          +
                          +  def measure_reuse(inputs, compressor)
                          +    reuse_by_timestamp = Hash.new(0)
                          +    inputs.each do |characters|
                          +      string = characters.join
                          +      timestamp = Solver.solution(string, compressor)
                          +      reuse_by_timestamp[timestamp] += 1
                          +    end
                          +    reuse_by_timestamp
                          +  end
                          +
                          +end
                          +
                          +

                          Updates


                          \ No newline at end of file diff --git a/about.html b/about.html new file mode 100644 index 0000000..14fc327 --- /dev/null +++ b/about.html @@ -0,0 +1,655 @@ +About - The Terminal Programmer

                          About

                          Suraj N. Kurapati

                          +

                          “What we do in life, echoes through eternity.” — Maximus

                          +
                          +

                          I’m a vegan, type INTJ 1w2, open source enthusiast, and computer engineer +who fell in love with computer programming as a +teenager and hasn’t looked back. :-) +You can send me an encrypted message at +the address specified in my public key.

                          +

                          1. Favorite things
                            1. Inspiration
                              1. Operation
                                1. Depiction
                                  1. Philosophy
                                  2. Notable works
                                    1. Academic research
                                      1. Graphical interface
                                        1. Telugu input methods
                                          1. wmii window manager
                                            1. dwm window manager
                                            2. Textual interface
                                              1. tmux terminal multiplexer
                                                1. Zsh interactive shell
                                                  1. (Neo)Vim text editor
                                                  2. Machine interface
                                                    1. Elixir programming language
                                                      1. Ruby programming language
                                                        1. Interpreter embedding
                                                          1. Writing documentation
                                                            1. Template rendering
                                                              1. Hardware testing
                                                                1. Software testing
                                                                  1. Project maintenance
                                                                    1. Window management
                                                                      1. Operating system
                                                                        1. Static blogging
                                                                          1. Web translation
                                                                            1. Language improvements
                                                                            2. UNIX shell environment
                                                                              1. Cron jobs
                                                                                1. For loops
                                                                                  1. File system
                                                                                    1. Desktop integration
                                                                                      1. Text alignment
                                                                                        1. Text wrapping
                                                                                          1. Software development
                                                                                            1. Software testing
                                                                                              1. Project management
                                                                                                1. Format conversion
                                                                                                2. C programming language
                                                                                                  1. Javascript programming language

                                                                                                + +

                                                                                                Favorite things

                                                                                                + +
                                                                                                +

                                                                                                “Those who are possessed by nothing possess everything.” — Morihei Ueshiba

                                                                                                +
                                                                                                +

                                                                                                +Hackles #75 - Hackles dreams of fame and glory.  It's tough being a programmer. Sometimes you are the only one who knows just how clever your code is. And in reality, of course, girls rarely swoon over your elegant coding practices... +

                                                                                                + +

                                                                                                Inspiration

                                                                                                + +
                                                                                                +

                                                                                                “Do not imitate the old masters. Seek what they sought.” — Basho

                                                                                                +
                                                                                                +

                                                                                                Speech:

                                                                                                + + +

                                                                                                Ideas:

                                                                                                + + +

                                                                                                Work:

                                                                                                + + +

                                                                                                Code:

                                                                                                + + +

                                                                                                Fun:

                                                                                                + + +

                                                                                                Lore:

                                                                                                + + + +

                                                                                                Operation

                                                                                                + +
                                                                                                +

                                                                                                “A bad workman blames his tools.” — English proverb

                                                                                                +
                                                                                                + + + +

                                                                                                Depiction

                                                                                                + +
                                                                                                +

                                                                                                “Water too pure has no fish.” — Caigentan

                                                                                                +
                                                                                                + + + +

                                                                                                Philosophy

                                                                                                + +
                                                                                                +

                                                                                                “First intention, then enlightenment.” — Buddha

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • “Mastering others is strength. Mastering yourself is true power.” — +Laozi

                                                                                                • +
                                                                                                • “A man ought to live in this world like a lotus leaf, which grows in +water but is never moistened by water.” — Swami Vivekananda

                                                                                                • +
                                                                                                • “Courage is standing up for what you believe in, even when you cannot +win.” — Goomoonryong

                                                                                                • +
                                                                                                • “If you think that you will be inferior in doing something, you will +be on that road very soon.” — Hagakure

                                                                                                • +
                                                                                                • “Why curse the darkness when you can light a candle? For all the +darkness in the world cannot extinguish the light of a single candle!” +— St. Francis of Assisi

                                                                                                • +
                                                                                                • “There is something to be learned from a rainstorm. When meeting with +a sudden shower, you try not to get wet and run quickly along the +road. But doing such things as passing under the eaves of houses, you +still get wet. When you are resolved from the beginning, you will not +be perplexed, though you still receive the same soaking. This +understanding extends to all things.” — Hagakure

                                                                                                • +
                                                                                                • “Iron is full of impurities that weaken it; through forging—by +exposure to heat, cold, and hammering—the impurities are forced out +and the iron is transformed into razor-sharp steel. Human beings +develop in the same fashion.” — Morihei Ueshiba

                                                                                                • +
                                                                                                • “Falling down a flight of one thousand stairs begins with slipping on +the first step.” — Confucius

                                                                                                • +
                                                                                                • “Holding onto anger is like grasping a hot coal with the intent of +throwing it at someone else; you are the one who gets burned.” — +Buddha

                                                                                                • +
                                                                                                • “One often meets his destiny on the road he takes to avoid it.” — +Oogway

                                                                                                • +
                                                                                                • “I’m tired of trying to do something worthwhile for the human race, +they simply don’t want to change!” — August Dvorak

                                                                                                • +
                                                                                                • “Everything you do in life will be insignificant, but it’s very +important that you do it.” — Mahatma Gandhi

                                                                                                • +
                                                                                                • “Do good and happiness will follow; but don’t get caught up in your +good deeds. Forget your past and don’t place any hope on the future. +Don’t regret the past… because if you do, it will consume you and +you’ll find no peace.” — Phra Khru Bah, speaking to orphaned children.

                                                                                                • +
                                                                                                • “You believe a man can change his destiny? — I believe a man does +what he can, until his destiny is revealed.” — Katsumoto & Algren

                                                                                                • +
                                                                                                • “He spirals down cold barren space as his safety rope spins silently +above him in the everlasting expanse of Mt. Everest” — ???

                                                                                                • +
                                                                                                • “In the Kamigata area, they have a sort of tiered lunchbox they use +for a single day when flower viewing. Upon returning, they throw them +away, trampling them underfoot. The end is important in all things.” +— Hagakure

                                                                                                • +
                                                                                                + +

                                                                                                Notable works

                                                                                                + +
                                                                                                +

                                                                                                “When you don’t create things, you become defined by your tastes rather +than ability. Your tastes only narrow and exclude people. So create.” +— Why the Lucky Stiff

                                                                                                +
                                                                                                + +

                                                                                                Academic research

                                                                                                + +
                                                                                                +

                                                                                                “A jug fills drop by drop.” — Buddha

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • Kurapati, S. N. (2007). Specification-driven functional verification +with Verilog PLI & VPI and SystemVerilog DPI. Masters thesis, University +of California, Santa Cruz. +[PDF] +[HTML]

                                                                                                • +
                                                                                                • Kurapati, S. N. (2005). A Brief Survey of High-Level Approaches to +Implementing Distributed Applications. Unpublished manuscript, +University of California, Santa Cruz. +[PDF] +[HTML]

                                                                                                • +
                                                                                                • Kurapati, S. N. (2004). Addiction to Massively Multi-player On-line +Games: An Ethical Analysis. Unpublished manuscript, University of +California, Santa Cruz. +[PDF] +[HTML]

                                                                                                • +
                                                                                                + +

                                                                                                Graphical interface

                                                                                                + + + +

                                                                                                Telugu input methods

                                                                                                +

                                                                                                Ways of typing the Telugu language into a computer:

                                                                                                + + + +

                                                                                                wmii window manager

                                                                                                + + + +

                                                                                                dwm window manager

                                                                                                + +
                                                                                                  +
                                                                                                • spawn_cwd: +Spawn from focused app’s working directory. See article.

                                                                                                • +
                                                                                                • sunaku.dwm: +My dwm configuration with Ruby status bar.

                                                                                                • +
                                                                                                + +

                                                                                                Textual interface

                                                                                                + +
                                                                                                  +
                                                                                                • dasht: +Search API docs offline, in your terminal or browser.

                                                                                                  +

                                                                                                  screenshot +screenshot

                                                                                                • +
                                                                                                + +

                                                                                                tmux terminal multiplexer

                                                                                                + + + +

                                                                                                Zsh interactive shell

                                                                                                + + + +

                                                                                                (Neo)Vim text editor

                                                                                                + +
                                                                                                  +
                                                                                                • sunaku.vim: +A modular Vim configuration: not a single, giant vimrc file!

                                                                                                • +
                                                                                                • vim-unbundle: +Fast & lazy bundle loader: a 50-line alternative to Pathogen.

                                                                                                • +
                                                                                                • vim-shortcut: +Discoverable shortcut system for Vim, inspired by +Spacemacs.

                                                                                                  +Screencast
                                                                                                • +
                                                                                                • vim-dasht: +Integrates the dasht offline API +search engine into (Neo)Vim.

                                                                                                • +
                                                                                                • vim-hicterm: +Highlights terminal color code numbers (think of ctermfg).

                                                                                                • +
                                                                                                +Screencast + + +

                                                                                                Machine interface

                                                                                                + +

                                                                                                Elixir programming language

                                                                                                + +
                                                                                                  +
                                                                                                • Patch: +Highlight differences in failed equality assertions. +See also gdiff.

                                                                                                  +

                                                                                                  string +map +integer

                                                                                                • +
                                                                                                + +

                                                                                                Ruby programming language

                                                                                                + +
                                                                                                + +

                                                                                                Interpreter embedding

                                                                                                +
                                                                                                + + + +
                                                                                                + +

                                                                                                Writing documentation

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • md2man: +Markdown to UNIX manpage converter.

                                                                                                • +
                                                                                                • binman: +UNIX manpages for executable scripts.

                                                                                                  +screenshot
                                                                                                • +
                                                                                                • erbook: +Write books, manuals, and documents in eRuby.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Template rendering

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • ember: +eRuby template processor.
                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Hardware testing

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • Ruby-VPI: +Ruby interface to IEEE 1364-2005 Verilog VPI.
                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Software testing

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • tork: +Runs tests as they change, in parallel.

                                                                                                • +
                                                                                                • guard-tork: +Guard integration for Tork.

                                                                                                • +
                                                                                                • detest: +Assertion testing library for Ruby.

                                                                                                • +
                                                                                                • test-unit-must: +Selfish “must” assertions for Test::Unit.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Project maintenance

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • inochi: +Infrastructure for Ruby projects.
                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Window management

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • rumai: +Ruby interface to 9P2000 protocol and WMII window manager.

                                                                                                  +current_view.diamond!
                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Operating system

                                                                                                +
                                                                                                + + + +
                                                                                                + +

                                                                                                Static blogging

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • readably: +Static blogs: YAML + Slim → HTML5 + Zenburn.

                                                                                                • +
                                                                                                • rassmalog: +Static blogging with YAML and eRuby.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Web translation

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • babelfish: +Ruby interface to Yahoo! BabelFish translation service.
                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Language improvements

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • Equal rights for Hash (like Array, String, Integer, and Float classes)

                                                                                                  + +
                                                                                                    +
                                                                                                  • Establish #to_h convention for turning objects into Hash.
                                                                                                  • +
                                                                                                  • Define NilClass#to_h() to convert nil into an empty Hash.
                                                                                                  • +
                                                                                                  • Add Kernel#Hash() for turning objects into Hash strictly.
                                                                                                  • +
                                                                                                  • See associated equal_rights_for_hash gem.
                                                                                                  • +
                                                                                                • +
                                                                                                • Add Object#singleton_class as shortcut to

                                                                                                  +
                                                                                                   class << object; self; end
                                                                                                  +
                                                                                                • +
                                                                                                • Add String#byteslice() to slice strings as byte chars, not wchars

                                                                                                • +
                                                                                                • Add File::write() as shortcut to

                                                                                                  +
                                                                                                   File.open(...) {|f| f.write(...) }
                                                                                                  +
                                                                                                • +
                                                                                                • Add File::FNM_EXTGLOB flag for {a,b} alternation in File::fnmatch?().

                                                                                                • +
                                                                                                • Embed Ruby inside co-routines such as libpc, pthread, and ucontext.

                                                                                                • +
                                                                                                • Order nested Kernel#at_exit() execution according to C’s atexit().

                                                                                                • +
                                                                                                • Consistency between Hash::[]( Array ) and Hash::[]( *Array ) constructors.

                                                                                                • +
                                                                                                • Improve power-efficiency by reducing CPU wakeups in timer thread.

                                                                                                • +
                                                                                                + +

                                                                                                UNIX shell environment

                                                                                                + +
                                                                                                +

                                                                                                “Simplicity is the heart of the UNIX philosophy. The more code lines you +have removed, the more progress you have made.” — The Suckless +Philosophy

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • home: +Tales from my home directory (dot files & bin scripts).
                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Cron jobs

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • admit1: +Admits only one instance of the given command to run at a time (by +running it only if there are no other instances already doing so).

                                                                                                • +
                                                                                                • canary: +Like a canary in a coal mine, this program exists to vocalize failures.

                                                                                                • +
                                                                                                • pigeon: +Like a carrier pigeon, this program exists to convey changes in status.

                                                                                                • +
                                                                                                • recur: +Repeatedly runs commands according to a given schedule until killed. +Useful for tailing log files that rotate at the end of each day/hour.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                For loops

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • each: +Runs commands for each argument.

                                                                                                • +
                                                                                                • ff: +Runs commands and scripts for each file.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                File system

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • du-h: +Disk usage, with live preview, sorted in human friendly format.

                                                                                                • +
                                                                                                • sort-h: +Reimplementation of sort -h for systems with a very old sort(1).

                                                                                                • +
                                                                                                • ls-summary: +Counts the number of different kinds of files in a directory.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Desktop integration

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • yank: +Copies from terminal to clipboard, even across nested tmux/SSH sessions! +See article.

                                                                                                • +
                                                                                                • xcd: +Runs command inside working directory of currently focused X11 window.

                                                                                                • +
                                                                                                • edit-text-field: +Edit currently focused text field in GVim.

                                                                                                • +
                                                                                                • screencast-window: +Take a video capture, in GIF format, of a single window.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Text alignment

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • align-columns: +Vertically aligns columns, which are delimited by a user-defined +regular expression, that are present in the input given on STDIN.

                                                                                                • +
                                                                                                • align-table: +Same as align-columns(1) above, but handles multiple delimiters.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Text wrapping

                                                                                                +
                                                                                                + + + +
                                                                                                + +

                                                                                                Software development

                                                                                                +
                                                                                                + + + +
                                                                                                + +

                                                                                                Software testing

                                                                                                +
                                                                                                + + + +
                                                                                                + +

                                                                                                Project management

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • floss-rebase: +Reapplies the stacked branch architecture: +master => other => patch => minor => major

                                                                                                • +
                                                                                                • floss-merge: +Merges all branches up to and including current branch into master branch.

                                                                                                • +
                                                                                                • floss-changes: +Prints release notes ranging from the current branch to the master branch.

                                                                                                • +
                                                                                                • floss-reflect: +Updates all text files in the project that mention the current version +and/or date to match the first version and date from the HISTORY_FILE.

                                                                                                • +
                                                                                                • floss-commit: +Creates a new commit or updates an existing commit that is labelled with +the first version and date from the HISTORY_FILE.

                                                                                                • +
                                                                                                • floss-publish: +Publishes manuals to the GitHub pages website after a project release.

                                                                                                • +
                                                                                                + +
                                                                                                + +

                                                                                                Format conversion

                                                                                                +
                                                                                                + +
                                                                                                  +
                                                                                                • iterm2xrdb: +Converts iTerm2 color schemes into xrdb(1) format.

                                                                                                • +
                                                                                                • xrdb2hterm: +Converts xrdb(1) color schemes into Chrome Secure Shell preferences.

                                                                                                • +
                                                                                                + +

                                                                                                C programming language

                                                                                                + +
                                                                                                  +
                                                                                                • knights-tour: +Knight’s Tour algorithm parallelized via GPGPU.

                                                                                                • +
                                                                                                • simple-ftp: +A rudimentary FTP server and command-line client.

                                                                                                • +
                                                                                                + +

                                                                                                Javascript programming language

                                                                                                + +
                                                                                                  +
                                                                                                • jquery-horizoll: +Horizontal screen scrolling with automatic realignment.

                                                                                                • +
                                                                                                • ofc2_to_png: +Renders “Open Flash Chart 2” JSON charts as PNG images.

                                                                                                • +
                                                                                                +

                                                                                                \ No newline at end of file diff --git a/acer-c720-linux.html b/acer-c720-linux.html new file mode 100644 index 0000000..db606fa --- /dev/null +++ b/acer-c720-linux.html @@ -0,0 +1,275 @@ +Lubuntu 14.10 on the Acer C720 Chromebook - The Terminal Programmer

                                                                                                Lubuntu 14.10 on the Acer C720 Chromebook

                                                                                                Suraj N. Kurapati

                                                                                                1. Setup
                                                                                                  1. Fixes
                                                                                                    1. Touchpad
                                                                                                      1. Kernel
                                                                                                        1. Power
                                                                                                          1. Wi-Fi
                                                                                                            1. Sound
                                                                                                              1. Keyboard
                                                                                                                1. Sleep
                                                                                                                  1. /etc/rc.local
                                                                                                                    1. /etc/pm/sleep.d/20_acer_c720_chromebook
                                                                                                                  2. Extras
                                                                                                                    1. Automatic HDMI
                                                                                                                      1. ~/bin/acer-c720-display
                                                                                                                        1. ~/bin/acer-c720-reactor
                                                                                                                      2. References

                                                                                                                        For six long months, I used a Crouton chroot (running Debian Sid) +alongside my Acer C720 Chromebook’s native Chrome OS as my primary +working environment: the Secure Shell extension provided direct, non-SSH +terminal access to the chroot, where I did all of my real work, while +Chrome browser provided a means to access my e-mail and the Internet.

                                                                                                                        +

                                                                                                                        However, I wasn’t able to reliably run graphical X11 applications in +Chrome OS when the +need arose occasionally (e.g. to display a plot in R or Octave) and, by +the time a workaround for this problem was identified, +my growing dissatisfaction with Chrome OS’ limitations and my concerns +over personal data and activities being collected, stored, and processed +in Google’s cloud prompted me to completely replace Chrome OS with a +standard Linux installation.

                                                                                                                        +

                                                                                                                        I tried Elementary OS Freya, Xubuntu 14.10, and Lubuntu 14.10 and +finally settled on the latter because it had the smallest operational +overhead (in terms of power, CPU, and memory consumption) when my laptop +was idle, according to Intel’s PowerTOP tool.

                                                                                                                        +

                                                                                                                        Now that this configuration has stabilized, having lasted an entire week +of continuous use (no shutdown, only suspend and resume) without any +problems, I decided to write this article and share it with the world: +documented below is how I replaced Chrome OS with Lubuntu 14.10 on my +Acer C720 Chromebook. May this knowledge liberate you from Google’s +clutchescloud as well. :-)

                                                                                                                        + +

                                                                                                                        Setup

                                                                                                                        + +
                                                                                                                          +
                                                                                                                        1. Install John Lewis’ custom Chromebook firmware as +described in the_unconventional’s guide. +Doing this eliminates the annoying time-delayed “scary boot screen”, +boots directly into SeaBIOS, fixes issues with Linux kernel modules.

                                                                                                                        2. +
                                                                                                                        3. Write the 64-bit Lubuntu 14.10 installation image to a USB stick:

                                                                                                                          +
                                                                                                                          sudo dd if=lubuntu-14.10-desktop-amd64.iso of=/dev/sdXYZ
                                                                                                                          +

                                                                                                                          Plug in your USB stick and run dmesg | tail to find the XYZ value.

                                                                                                                        4. +
                                                                                                                        5. Boot your Acer C720 Chromebook from the USB stick prepared above.

                                                                                                                        6. +
                                                                                                                        7. Choose “Try Lubuntu without installing” at the USB stick’s boot menu.

                                                                                                                        8. +
                                                                                                                        9. Press Control+Alt+T to open a terminal and then type in the following:

                                                                                                                          +
                                                                                                                          xbacklight = 15 # temporarily reduce laptop's display brightness
                                                                                                                          +sudo swapoff -a # disable swap to avoid security error later on
                                                                                                                          +
                                                                                                                        10. +
                                                                                                                        11. Double-click the “Install Lubuntu 14.10” icon on the desktop to start +the installation process, in which:

                                                                                                                          + +
                                                                                                                            +
                                                                                                                          1. Choose “Erase disk and install Lubuntu”.
                                                                                                                          2. +
                                                                                                                          3. Choose “Encrypt the new Lubuntu installation for security”. Make +sure to turn off swap by running sudo swapoff -a before entering +your encryption passphrase to avoid a security error that aborts +the installation.
                                                                                                                          4. +
                                                                                                                          5. Choose “Use LVM with the new Lubuntu installation”.
                                                                                                                          6. +
                                                                                                                          7. Choose “Continue Testing” instead of rebooting.
                                                                                                                          8. +
                                                                                                                        12. +
                                                                                                                        13. Press Control+Alt+T to open a terminal and then type in the following:

                                                                                                                          +
                                                                                                                          sudo -s
                                                                                                                          +swapoff -a
                                                                                                                          +lvremove /dev/lubuntu-vg/swap_1
                                                                                                                          +lvextend --extents +100%FREE /dev/lubuntu-vg/root
                                                                                                                          +e2fsck -f /dev/lubuntu-vg/root
                                                                                                                          +resize2fs /dev/lubuntu-vg/root
                                                                                                                          +

                                                                                                                          This will absorb the encrypted swap volume into your root volume, +thereby giving you an extra 4 GiB (or 2 GiB depending on your +Chromebook model) of disk space to work with.

                                                                                                                        14. +
                                                                                                                        15. Reboot the computer when you are ready to start using Lubuntu 14.10.

                                                                                                                        16. +
                                                                                                                        17. Disable encrypted swap, which the root volume absorbed earlier:

                                                                                                                          +
                                                                                                                          sudo sed -i 's,^/dev/mapper/lubuntu--vg-swap_1,#&,' /etc/fstab
                                                                                                                          +
                                                                                                                        18. +
                                                                                                                        19. Enable TRIM support on the root volume since it’s on a solid state disk:

                                                                                                                          +
                                                                                                                          sudo sed -i '/vg-root/s/errors=remount-ro/&,noatime,discard/' /etc/fstab
                                                                                                                          +
                                                                                                                        20. +
                                                                                                                        + +

                                                                                                                        Fixes

                                                                                                                        +

                                                                                                                        After successful installation, apply the following fixes.

                                                                                                                        + +

                                                                                                                        Touchpad

                                                                                                                        +

                                                                                                                        Enable touchpad by upgrading your Linux kernel to version 3.17 or newer, +which has the touchpad driver built-in. To do this, download the upgrade +packages +(namely the linux-headers*amd64.deb and linux-generic*amd64.deb files) +and install them using the sudo dpkg -i command.

                                                                                                                        + +

                                                                                                                        Kernel

                                                                                                                        +

                                                                                                                        Prevent system freezes that randomly occur under Linux kernel 3.17+:

                                                                                                                        +
                                                                                                                        echo 'options i915 semaphores=0' | sudo tee -a /etc/modprobe.d/i915.conf
                                                                                                                        +

                                                                                                                        I arrived at the above solution by starting with John Lewis’ suggested +workaround and +experimentally removing redundant overrides (according to modinfo i915 | +grep parm output) that re-specified default values.

                                                                                                                        + +

                                                                                                                        Power

                                                                                                                        +

                                                                                                                        Prevent instant shutdown when power key is (accidentally) pressed:

                                                                                                                        +
                                                                                                                        echo 'HandlePowerKey=ignore' | sudo tee -a /etc/systemd/logind.conf
                                                                                                                        +
                                                                                                                        +

                                                                                                                        Wi-Fi

                                                                                                                        +

                                                                                                                        Enable Wi-Fi power savings and improve connection stability:

                                                                                                                        +
                                                                                                                        echo 'options ath9k ps_enable=1 use_chanctx=1 btcoex_enable=1 bt_ant_diversity=1' | sudo tee -a /etc/modprobe.d/ath9k.conf
                                                                                                                        +
                                                                                                                        +

                                                                                                                        Sound

                                                                                                                        +

                                                                                                                        Specify the sound card that alsamixer(1) should use by default:

                                                                                                                        +
                                                                                                                        echo 'options snd_hda_intel index=1' | sudo tee -a /etc/modprobe.d/alsa.conf
                                                                                                                        +
                                                                                                                        +

                                                                                                                        Keyboard

                                                                                                                        +

                                                                                                                        Install the Chromebook keyboard layout provided by +Crouton:

                                                                                                                        +
                                                                                                                        wget https://raw.githubusercontent.com/dnschneid/crouton/master/targets/keyboard
                                                                                                                        +sudo env DISTRO=debian bash ./keyboard
                                                                                                                        +

                                                                                                                        Apply the Chromebook keyboard layout from within an X11 session:

                                                                                                                        +
                                                                                                                        setxkbmap -model chromebook
                                                                                                                        +
                                                                                                                        +

                                                                                                                        Sleep

                                                                                                                        +

                                                                                                                        Make suspend and resume work correcly when lid is closed and opened:

                                                                                                                        + +

                                                                                                                        /etc/rc.local

                                                                                                                        +
                                                                                                                        #!/bin/sh -e
                                                                                                                        +#
                                                                                                                        +# rc.local
                                                                                                                        +#
                                                                                                                        +# This script is executed at the end of each multiuser runlevel.
                                                                                                                        +# Make sure that the script will "exit 0" on success or any other
                                                                                                                        +# value on error.
                                                                                                                        +#
                                                                                                                        +# In order to enable or disable this script just change the execution
                                                                                                                        +# bits.
                                                                                                                        +#
                                                                                                                        +# By default this script does nothing.
                                                                                                                        +
                                                                                                                        +# prevent ehci-pci errors that occur after resume from suspend:
                                                                                                                        +# [  386.093443] ehci-pci 0000:00:1d.0: port 2 resume error -19
                                                                                                                        +# [  386.093699] ehci-pci 0000:00:1d.0: port 1 resume error -19
                                                                                                                        +echo -n 0000:00:1d.0 > /sys/bus/pci/drivers/ehci-pci/unbind
                                                                                                                        +
                                                                                                                        +/etc/pm/sleep.d/20_acer_c720_chromebook
                                                                                                                        +
                                                                                                                        +exit 0
                                                                                                                        +
                                                                                                                        +

                                                                                                                        /etc/pm/sleep.d/20_acer_c720_chromebook

                                                                                                                        +
                                                                                                                        #!/bin/sh
                                                                                                                        +# the following tweaks were suggested by powertop https://01.org/powertop
                                                                                                                        +
                                                                                                                        +# turn off bluetooth, which causes OS hangs
                                                                                                                        +rfkill block bluetooth
                                                                                                                        +
                                                                                                                        +# Wireless Power Saving for interface wlan0
                                                                                                                        +iwconfig wlan0 power on
                                                                                                                        +
                                                                                                                        +# NMI watchdog should be turned off
                                                                                                                        +echo 0 > /proc/sys/kernel/nmi_watchdog
                                                                                                                        +
                                                                                                                        +# VM writeback timeout
                                                                                                                        +echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
                                                                                                                        +
                                                                                                                        +# Enable audio codec power management
                                                                                                                        +echo 1 > /sys/module/snd_hda_intel/parameters/power_save
                                                                                                                        +
                                                                                                                        +# Enable SATA link power Management for *
                                                                                                                        +for policy in /sys/class/scsi_host/*/link_power_management_policy
                                                                                                                        +do echo min_power > $policy
                                                                                                                        +done
                                                                                                                        +
                                                                                                                        +# Runtime PM for PCI Device *
                                                                                                                        +for control in /sys/bus/pci/devices/*/power/control
                                                                                                                        +do echo auto > $control
                                                                                                                        +done
                                                                                                                        +
                                                                                                                        +# Runtime PM for PCI Device Intel Corporation 8 Series USB xHCI HC
                                                                                                                        +echo auto > /sys/bus/pci/devices/0000:00:14.0/power/control
                                                                                                                        +
                                                                                                                        +# Runtime PM for PCI Device Intel Corporation 8 Series USB EHCI #1
                                                                                                                        +echo auto > /sys/bus/pci/devices/0000:00:1d.0/power/control
                                                                                                                        +
                                                                                                                        +

                                                                                                                        Extras

                                                                                                                        +

                                                                                                                        After successful installation, you can set up these extras.

                                                                                                                        + +
                                                                                                                          +
                                                                                                                        1. Install skippy-xd to emulate Chrome OS’ window list (F5) key:

                                                                                                                          +
                                                                                                                          sudo add-apt-repository ppa:landronimirc/skippy-xd-daily
                                                                                                                          +sudo apt-get update && sudo apt-get install skippy-xd
                                                                                                                          +
                                                                                                                        2. +
                                                                                                                        3. Fix zsh-history-substring-search reverse video highlighting in tmux:

                                                                                                                          +
                                                                                                                          wget https://mirrors.kernel.org/ubuntu/pool/main/n/ncurses/ncurses-base_5.9+20140118-1ubuntu1_all.deb
                                                                                                                          +sudo dpkg -i ncurses-base_5.9+20140118-1ubuntu1_all.deb
                                                                                                                          +sudo apt-mark hold ncurses-base
                                                                                                                          +
                                                                                                                        4. +
                                                                                                                        5. Get low-battery notifications from LXDE’s battery monitor:

                                                                                                                          + +
                                                                                                                            +
                                                                                                                          1. Right-click on the panel (task bar)
                                                                                                                          2. +
                                                                                                                          3. Choose “Add / Remove Panel Items”
                                                                                                                          4. +
                                                                                                                          5. Click the “Add” button
                                                                                                                          6. +
                                                                                                                          7. Choose “Battery Monitor” from the list
                                                                                                                          8. +
                                                                                                                          9. Click the “Edit” button
                                                                                                                          10. +
                                                                                                                          11. Set the “Alarm command” field to:

                                                                                                                            +
                                                                                                                            notify-send -u critical -i battery-empty "Your battery is low" "Plug in the charger!" || xmessage Battery low
                                                                                                                            +

                                                                                                                            Note that you must install sudo apt-get install libnotify-bin +in order to receive fancy notifications from the command above.

                                                                                                                          12. +
                                                                                                                          13. Set the “Alarm time (minutes left)” field to: 30

                                                                                                                          14. +
                                                                                                                        6. +
                                                                                                                        + +

                                                                                                                        Automatic HDMI

                                                                                                                        +

                                                                                                                        The following scripts configure external displays automatically:

                                                                                                                        + +
                                                                                                                          +
                                                                                                                        • plugin in a HDMI cable and the external display will be used
                                                                                                                        • +
                                                                                                                        • unplug the HDMI cable and the internal display will be used
                                                                                                                        • +
                                                                                                                        +

                                                                                                                        Simply run acer-c720-reactor& after starting LXDE to use them.

                                                                                                                        + +

                                                                                                                        ~/bin/acer-c720-display

                                                                                                                        +
                                                                                                                        #!/bin/sh
                                                                                                                        +# Uses external display if connected; or internal display otherwise.
                                                                                                                        +
                                                                                                                        +if grep -q '^connected' /sys/class/drm/card0-HDMI-A-1/status
                                                                                                                        +then xrandr --output HDMI1 --auto --dpi 96 --output eDP1 --off
                                                                                                                        +else xrandr --auto
                                                                                                                        +fi
                                                                                                                        +
                                                                                                                        +

                                                                                                                        ~/bin/acer-c720-reactor

                                                                                                                        +
                                                                                                                        #!/bin/sh
                                                                                                                        +# Reacts to hardware events and (re)configures the system accordingly.
                                                                                                                        +
                                                                                                                        +trap "kill -- -$$" EXIT # terminate all background processes on exit
                                                                                                                        +trap exit INT TERM # ensure the above trap is triggered on interrupt
                                                                                                                        +
                                                                                                                        +dmesg='dmesg --facility auth'
                                                                                                                        +depth=$($dmesg | awk '
                                                                                                                        +  / systemd-logind.+: New session c.+ of user .+/ { depth=NR }
                                                                                                                        +  END { print depth-1 }
                                                                                                                        +')
                                                                                                                        +$dmesg --follow | {
                                                                                                                        +  # discard old events
                                                                                                                        +  i=1
                                                                                                                        +  while [ $i -le $depth ]; do
                                                                                                                        +    read _discard
                                                                                                                        +    i=$(( i + 1 ))
                                                                                                                        +  done
                                                                                                                        +
                                                                                                                        +  # process new events
                                                                                                                        +  while read event; do
                                                                                                                        +    case "$event" in
                                                                                                                        +      # lock screen was unlocked after initial login
                                                                                                                        +      # or after the laptop was resumed from suspend
                                                                                                                        +      (*' systemd-logind'*': New session c'*'of user '*\
                                                                                                                        +      |*' systemd-logind'*': Lid opened.'\
                                                                                                                        +      |*' systemd-logind'*': Operation finished.')
                                                                                                                        +        acer-c720-docking
                                                                                                                        +        ;;
                                                                                                                        +    esac
                                                                                                                        +  done
                                                                                                                        +} &
                                                                                                                        +
                                                                                                                        +stdbuf -oL udevadm monitor --udev | while read event; do
                                                                                                                        +  case "$event" in
                                                                                                                        +    # HDMI cable was either plugged in or unplugged
                                                                                                                        +    (*' change '*'/devices/pci0000:00/0000:00:02.0/drm/card0 (drm)')
                                                                                                                        +      acer-c720-display
                                                                                                                        +      ;;
                                                                                                                        +  esac
                                                                                                                        +done &
                                                                                                                        +
                                                                                                                        +wait
                                                                                                                        +
                                                                                                                        +

                                                                                                                        References

                                                                                                                        + + +

                                                                                                                        \ No newline at end of file diff --git a/chess-diagrams-in-lyx-with-pdflatex.html b/chess-diagrams-in-lyx-with-pdflatex.html new file mode 100644 index 0000000..6db00a0 --- /dev/null +++ b/chess-diagrams-in-lyx-with-pdflatex.html @@ -0,0 +1,20 @@ +Chess diagrams in LyX with PDFLaTeX - The Terminal Programmer

                                                                                                                        Chess diagrams in LyX with PDFLaTeX

                                                                                                                        Suraj N. Kurapati

                                                                                                                        LyX 1.4.3 fails to generate a PDF with PDFLaTeX if you +have chess diagrams in your document. The solution is to enable the +chess package in your LyX document’s LaTeX preamble, as follows.

                                                                                                                        +
                                                                                                                        \usepackage{chess}
                                                                                                                        +

                                                                                                                        As obvious as this may seem, it took nearly three hours of fiddling +around and scouring the web before I happened upon this gem of a +solution.

                                                                                                                        +

                                                                                                                        Furthermore, I use the following in my document’s LaTeX preamble to enable +chess diagrams for presentations with +LaTeX-beamer (the “Beamer +Presentation Class” document class in LyX).

                                                                                                                        +
                                                                                                                        % for chess diagrams
                                                                                                                        +\usepackage[ps,mover]{lyxskak}
                                                                                                                        +\newgame
                                                                                                                        +\usepackage{chess} % to make it work in pdflatex
                                                                                                                        +

                                                                                                                        \ No newline at end of file diff --git a/compiling-jedit-in-ubuntu-linux.html b/compiling-jedit-in-ubuntu-linux.html new file mode 100644 index 0000000..bd408cf --- /dev/null +++ b/compiling-jedit-in-ubuntu-linux.html @@ -0,0 +1,32 @@ +Compiling jEdit under Ubuntu - The Terminal Programmer

                                                                                                                        Compiling jEdit under Ubuntu

                                                                                                                        Suraj N. Kurapati

                                                                                                                        Here I’ll show you how to compile the jEdit text +editor from source in Ubuntu GNU/Linux.

                                                                                                                        + +
                                                                                                                          +
                                                                                                                        1. Install the Sun JDK for Java 5.

                                                                                                                        2. +
                                                                                                                        3. Install the following packages:

                                                                                                                          +
                                                                                                                          sudo apt-get install ant ant-optional xsltproc \
                                                                                                                          +docbook docbook-xml docbook-xsl passivetex
                                                                                                                          +
                                                                                                                        4. +
                                                                                                                        5. Download Apache FOP and +extract it into your system’s temporary directory: /tmp

                                                                                                                        6. +
                                                                                                                        7. Obtain jEdit’s source code from its SVN repository:

                                                                                                                          +
                                                                                                                          svn co https://svn.sourceforge.net/svnroot/jedit/jEdit/trunk
                                                                                                                          +
                                                                                                                        8. +
                                                                                                                        9. Save the following text to a file named build.properties:

                                                                                                                          +
                                                                                                                          build.dir=build
                                                                                                                          +dist.dir=dist
                                                                                                                          +xsltproc.executable=/usr/bin/xsltproc
                                                                                                                          +docbook.xsl=/usr/share/xml/docbook/stylesheet/nwalsh/
                                                                                                                          +docbook.catalog=/usr/share/xml/docbook/schema/dtd/4.2/catalog
                                                                                                                          +fop.dir=/tmp/fop-0.20.5
                                                                                                                          +
                                                                                                                        10. +
                                                                                                                        11. Build the distribution from the source code:

                                                                                                                          +
                                                                                                                          ant dist
                                                                                                                          +
                                                                                                                        12. +
                                                                                                                        13. Look inside the dist directory to enjoy the fruit of your labor! :)

                                                                                                                        14. +
                                                                                                                        +

                                                                                                                        \ No newline at end of file diff --git a/compiling-workrave-in-fedora-core-4.html b/compiling-workrave-in-fedora-core-4.html new file mode 100644 index 0000000..f9ba928 --- /dev/null +++ b/compiling-workrave-in-fedora-core-4.html @@ -0,0 +1,23 @@ +Compiling Workrave in Fedora Core 4 - The Terminal Programmer

                                                                                                                        Compiling Workrave in Fedora Core 4

                                                                                                                        Suraj N. Kurapati

                                                                                                                        Workrave is a fantastic break-reminder program which +aids the responsible user in preventing RSI and eye-strain. It is far better +than gnome-typing-monitor, which periodically invokes instinctual panic by +flashing a red square whence less than one minute remains before a break!

                                                                                                                        +

                                                                                                                        Presently, there is no pre-built binary package for Workrave under Fedora Core +4, so I’ve had to track down dependencies and compile it myself. The necessary +dependencies can be installed by executing this command:

                                                                                                                        +
                                                                                                                        yum install '[lg]**mm**devel' gnome-panel-devel gnet2-devel
                                                                                                                        +

                                                                                                                        After doing this, the source package compiles smoothly, without dependency +errors.

                                                                                                                        +

                                                                                                                        I should also mention that I am using, in addition to the default Fedora +repositories, the DAG, +Dries, +FreshRPMS, and +Livna repositories—whose yum repo +files can be acquired here.

                                                                                                                        +

                                                                                                                        Place these repo files into /etc/yum.repos.d to make use of the +aforementioned repositories.

                                                                                                                        +

                                                                                                                        \ No newline at end of file diff --git a/contest-rails-testing-monkeypatch.html b/contest-rails-testing-monkeypatch.html new file mode 100644 index 0000000..6b723cd --- /dev/null +++ b/contest-rails-testing-monkeypatch.html @@ -0,0 +1,56 @@ +Using Contest's context() in Rails' controller tests - The Terminal Programmer

                                                                                                                        Using Contest's context() in Rails' controller tests

                                                                                                                        Suraj N. Kurapati

                                                                                                                        Contest is a Ruby library that brings Shoulda-style nestable +contexts, in the form of context() methods, and an easier way to define +test blocks, in the form of should() methods, to Ruby’s Test::Unit +testing framework.

                                                                                                                        +

                                                                                                                        When used inside a Rails’ controller test, Contest’s context() +method raises the following error:

                                                                                                                        +
                                                                                                                        RuntimeError: @controller is nil: make sure you set it in your test's setup method.
                                                                                                                        +

                                                                                                                        For example, the following controller test triggers the error:

                                                                                                                        +
                                                                                                                        require 'test_helper'
                                                                                                                        +require 'contest'
                                                                                                                        +
                                                                                                                        +class ExamplesControllerTest < ActionController::TestCase
                                                                                                                        +  context "index action" do
                                                                                                                        +    should "return a list of examples" do
                                                                                                                        +      get :index, :format => :json
                                                                                                                        +      assert_response :success
                                                                                                                        +    end
                                                                                                                        +  end
                                                                                                                        +end
                                                                                                                        +

                                                                                                                        This happens because, internally, the context() method creates a new +Test::Unit::TestCase-derived class whose name does not contain that of +the parent controller test (which is ExamplesController in the above +example). As a result, Rails complains when it is unable to automatically +set the @controller instance variable inside the block passed to the +context() method.

                                                                                                                        +

                                                                                                                        Robert Gleeson suggested a workaround where you manually assign the +correct value to the @controller instance variable on behalf of Rails in +the created context’s setup() block:

                                                                                                                        +
                                                                                                                        context "index action" do
                                                                                                                        +  setup do
                                                                                                                        +    @controller = ExamplesController.new
                                                                                                                        +  end
                                                                                                                        +  # ...
                                                                                                                        +end
                                                                                                                        +

                                                                                                                        I automated the application of this workaround through the following +monkeypatch, which you can add directly to your Rails’ test helper file:

                                                                                                                        +
                                                                                                                        class ActionController::TestCase
                                                                                                                        +  def self.context *args, &block
                                                                                                                        +    super *args do
                                                                                                                        +      setup do
                                                                                                                        +        # establish the rails controller being tested
                                                                                                                        +        # https://github.com/citrusbyte/contest/issues/5#issuecomment-677003
                                                                                                                        +        ancestors = self.class.ancestors
                                                                                                                        +        test_case = ancestors[ancestors.index(ActionController::TestCase)-1]
                                                                                                                        +        @controller = test_case.controller_class.new
                                                                                                                        +      end
                                                                                                                        +      class_eval &block
                                                                                                                        +    end
                                                                                                                        +  end
                                                                                                                        +end
                                                                                                                        +

                                                                                                                        And with that, you are now riding the Rails, Contest style! :-)

                                                                                                                        +

                                                                                                                        \ No newline at end of file diff --git a/copyleft-mit-license.html b/copyleft-mit-license.html new file mode 100644 index 0000000..ea8246e --- /dev/null +++ b/copyleft-mit-license.html @@ -0,0 +1,147 @@ +Copyleft variation of the MIT license - The Terminal Programmer

                                                                                                                        Copyleft variation of the MIT license

                                                                                                                        Suraj N. Kurapati


                                                                                                                        1. Beliefs
                                                                                                                          1. Candidates
                                                                                                                            1. Approach
                                                                                                                              1. Result
                                                                                                                                1. Analysis

                                                                                                                                  I had been using the GNU General Public +License for some years now without +fully understanding its implications. Recently, I spent some time thinking +about my ethical beliefs regarding free software and discovered that the GPL +does not satisfy them. I investigated other open source licenses, but nothing +fit. So, with the help of others, I developed a copyleft variation of the +famous MIT license.

                                                                                                                                  + +

                                                                                                                                  Beliefs

                                                                                                                                  +

                                                                                                                                  These are my ethical beliefs regarding open-source software:

                                                                                                                                  + +
                                                                                                                                    +
                                                                                                                                  • Source code should always be available for software because it allows the user to learn from and improve upon the software. In line with the academic spirit, this ensures that everyone has access to knowledge (the source code) – not just an elite few.

                                                                                                                                  • +
                                                                                                                                  • The license should only govern my source code and derivatives of it – nothing more. In this manner, I avoid imposing my beliefs on software that simply uses my source code.

                                                                                                                                  • +
                                                                                                                                  + +

                                                                                                                                  Candidates

                                                                                                                                  +

                                                                                                                                  The license that best embodies my ethical beliefs is the Creative Commons’ +by-sa (attribution + share- +alike) license. In particular, I like by-sa because it ensures that my source +code (and derivatives of it) will never be locked away or kept secret.

                                                                                                                                  +

                                                                                                                                  Unfortunately, CC does not recommend using their licenses for software. A +friend suggested that I try the SleepyCat +license, whose copyleft +condition (the third condition) states:

                                                                                                                                  + +
                                                                                                                                  +

                                                                                                                                  Redistributions in any form must be accompanied by information on how to +obtain complete source code for the DB software and any accompanying +software that uses the DB software. The source code must either be included +in the distribution or be available for no more than the cost of distribution +plus a nominal fee, and must be freely redistributable under reasonable +conditions. For an executable file, complete source code means the source +code for all modules it contains. It does not include source code for modules +or files that typically accompany the major components of the operating system +on which the executable file runs.

                                                                                                                                  +
                                                                                                                                  +

                                                                                                                                  I found this condition to be:

                                                                                                                                  + +
                                                                                                                                    +
                                                                                                                                  • too aggressive: I only want the license to govern my source code and its derivatives. I do not wish to impose the copyleft condition on any accompanying software that uses my source code.

                                                                                                                                  • +
                                                                                                                                  • too brittle: In the phrase “must be freely redistributable under reasonable conditions”, what is considered to be reasonable?

                                                                                                                                  • +
                                                                                                                                  +

                                                                                                                                  The term reasonable is very subjective, and I can easily imagine it being +abused by evildoers. Ultimately, a judge will have to decide the meaning of +this word in court.

                                                                                                                                  +

                                                                                                                                  I looked at other licenses that fit the by-sa ideology (particularly MPL, +CDDL, CPL, EPL) but found them all to be very lengthy and full of legalese. In +contrast, I admire the short length and great comprehensibility of the MIT +license and so, I decided to make a copyleft variation of it.

                                                                                                                                  + +

                                                                                                                                  Approach

                                                                                                                                  +

                                                                                                                                  The MIT license has the following properties (from Ed Burnette’s +survey of free software licenses):

                                                                                                                                  + +
                                                                                                                                  +
                                                                                                                                    +
                                                                                                                                  1. Code is protected by copyright? Yes
                                                                                                                                  2. +
                                                                                                                                  3. Code can be used in closed source projects? Yes
                                                                                                                                  4. +
                                                                                                                                  5. Program that uses (incorporates) the software can be sold commercially? Yes
                                                                                                                                  6. +
                                                                                                                                  7. Source to bug fixes and modifications must be released? No
                                                                                                                                  8. +
                                                                                                                                  9. Provides explicit patent license? No
                                                                                                                                  10. +
                                                                                                                                  +
                                                                                                                                  +

                                                                                                                                  My goal was to modify the condition paragraph of the MIT license so that +question 4 above is given a “Yes” answer. The resulting license is a weak +copyleft variation of the MIT license.

                                                                                                                                  + +

                                                                                                                                  Result

                                                                                                                                  +
                                                                                                                                  Copyright <year> <holder>
                                                                                                                                  +
                                                                                                                                  +Permission is hereby granted, free of charge, to any person obtaining a
                                                                                                                                  +copy of this software and associated documentation files (the "Software"),
                                                                                                                                  +to deal in the Software without restriction, including without limitation
                                                                                                                                  +the rights to use, copy, modify, merge, publish, distribute, sublicense,
                                                                                                                                  +and/or sell copies of the Software, and to permit persons to whom the
                                                                                                                                  +Software is furnished to do so, subject to the following conditions:
                                                                                                                                  +* All copies and substantial portions of the Software (the "Derivatives")
                                                                                                                                  +  and their corresponding machine-readable source code (the "Code") must
                                                                                                                                  +  include the above copyright notice and this permission notice.
                                                                                                                                  +
                                                                                                                                  +* Upon distribution, the Derivatives must be accompanied by either the Code
                                                                                                                                  +  or--provided that the Code is obtainable for no more than the cost of
                                                                                                                                  +  distribution plus a nominal fee--information on how to obtain the Code.
                                                                                                                                  +
                                                                                                                                  +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
                                                                                                                                  +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
                                                                                                                                  +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
                                                                                                                                  +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
                                                                                                                                  +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
                                                                                                                                  +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
                                                                                                                                  +

                                                                                                                                  The license shown above is the end result of several revisions made in +response to and with the help of friends and various people on the debian- +legal and +license-discuss mailing lists and +the IRC chat room for the wmii project.

                                                                                                                                  +

                                                                                                                                  Many discouraged me from pursuing my own license because I was inadvertently +contributing to the problem of license +proliferation, but I proceeded nonetheless +because no existing license served my particular ethical beliefs so concisely +as this.

                                                                                                                                  +

                                                                                                                                  This license appears to satisfy the Open Source Definition +(OSD), Debian Free Software Guidelines +(DFSG), the three tests +(desert island, dissident, and tentacles of evil) outlined in the DFSG- +FAQ, and GPL compatibility +which the Free Software Foundation (FSF) is presently in the process of +verifying. However, only OSD compliance has been +verified thus far.

                                                                                                                                  + +

                                                                                                                                  Analysis

                                                                                                                                  +

                                                                                                                                  This license is literally identical to the MIT license except for:

                                                                                                                                  + +
                                                                                                                                    +
                                                                                                                                  1. The removal of the (c) token from the copyright notice because it is not a legally recognized substitute for the real © symbol.

                                                                                                                                  2. +
                                                                                                                                  3. The list of conditions, in the middle.

                                                                                                                                  4. +
                                                                                                                                  +

                                                                                                                                  Now, let us examine the list of conditions one by one.

                                                                                                                                  + +
                                                                                                                                  +

                                                                                                                                  All copies and substantial portions of the Software (the “Derivatives”) and +their corresponding machine-readable source code (the “Code”) must include the +above copyright notice and this permission notice.

                                                                                                                                  +
                                                                                                                                  +

                                                                                                                                  This condition ensures that the copyright and permission notice are never +removed from the software. Does this sound familiar? Of course! This +condition is simply a restatement of the original MIT license’s condition +paragraph.

                                                                                                                                  + +
                                                                                                                                  +

                                                                                                                                  Upon distribution, the Derivatives must be accompanied by either the Code or +–provided that the Code is obtainable for no more than the cost of +distribution plus a nominal fee–information on how to obtain the Code.

                                                                                                                                  +
                                                                                                                                  +

                                                                                                                                  This condition ensures access to the software’s source code because the code +is either (1) distributed along with the software or (2) obtainable by some +other means. This is the primary innovation that makes this license a +copyleft variation of the MIT license.

                                                                                                                                  +

                                                                                                                                  Updates


                                                                                                                                  Readably written, Everforest colored.

                                                                                                                                  Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                  +
                                                                                                                                  \ No newline at end of file diff --git a/dactyl-manuform-5x6-keyboard.html b/dactyl-manuform-5x6-keyboard.html new file mode 100644 index 0000000..e0e80f4 --- /dev/null +++ b/dactyl-manuform-5x6-keyboard.html @@ -0,0 +1,403 @@ +Dactyl Manuform 5x6 programmable ergonomic keyboard - The Terminal Programmer

                                                                                                                                  Dactyl Manuform 5x6 programmable ergonomic keyboard

                                                                                                                                  Suraj N. Kurapati

                                                                                                                                  +

                                                                                                                                  DEPRECATED: This has been superseded by the MoErgo Glove80 keyboard.

                                                                                                                                  +

                                                                                                                                  NOTE: Check out the interactive layer map for this keyboard below!

                                                                                                                                  +
                                                                                                                                  +

                                                                                                                                  Photograph of my Dactyl Manuform 5x6 keyboard. +

                                                                                                                                  +

                                                                                                                                  This is my Dactyl Manuform keyboard: specifically, a 5-row and 6-column (5x6) +variant manufactured by Ergohaven that I fitted with colorful Rainbow keycaps, +tactile brown key-switches, and enhanced firmware with legendary Miryoku design.

                                                                                                                                  + +
                                                                                                                                  +

                                                                                                                                  Video: Introduction to the Dactyl Manuform keyboard.

                                                                                                                                  +

                                                                                                                                  Click to watch video

                                                                                                                                  +
                                                                                                                                  +

                                                                                                                                  Prior to this, I used an ErgoDox EZ keyboard for 6 years and then a Kinesis +Advantage keyboard for 11 years before that. All of these have a shared lineage: +the Advantage has contoured keywells but isn’t split, the ErgoDox is split but +isn’t contoured, and the Dactyl has the best of both: it’s split and contoured!

                                                                                                                                  +

                                                                                                                                  1. Layers
                                                                                                                                    1. Cursor layer
                                                                                                                                      1. Arrow keys
                                                                                                                                        1. Select & edit
                                                                                                                                        2. Number layer
                                                                                                                                          1. Prefix signs
                                                                                                                                            1. Date & time
                                                                                                                                              1. Inequalities
                                                                                                                                              2. Function layer
                                                                                                                                                1. Symbol layer
                                                                                                                                                  1. Base layer affinity
                                                                                                                                                    1. Vim editor shortcuts
                                                                                                                                                      1. Adjacent key bigrams
                                                                                                                                                        1. Outer corner bigrams
                                                                                                                                                          1. Inward rolling bigrams
                                                                                                                                                            1. Outward rolling bigrams
                                                                                                                                                            2. Mouse layer
                                                                                                                                                              1. Light layer
                                                                                                                                                              2. Firmware
                                                                                                                                                                1. Extra QMK patches
                                                                                                                                                                  1. QMK configurator app
                                                                                                                                                                    1. Building the firmware

                                                                                                                                                                    + +

                                                                                                                                                                    Layers

                                                                                                                                                                    +

                                                                                                                                                                    The keyboard boots up into the following default “base” layer when powered on. +When held, the purple keys in the thumb +clusters activate the subsequent layers according to the legendary Miryoku’s +6-layer design with 3-key thumb activation.

                                                                                                                                                                    + +
                                                                                                                                                                    +

                                                                                                                                                                    Interactive: Hover your mouse over the purple keys to see each layer! +

                                                                                                                                                                    +
                                                                                                                                                                    + + +

                                                                                                                                                                    The keys are arranged in my variation of Arno Klein’s Engram +2.0 layout and they’re imbued with the legendary Miryoku home +row mods tamed with enhancements.

                                                                                                                                                                    + +

                                                                                                                                                                    Cursor layer

                                                                                                                                                                    +

                                                                                                                                                                    Diagram of the cursor layer. +

                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Arrow keys

                                                                                                                                                                    +
                                                                                                                                                                    +

                                                                                                                                                                    The up/down arrow keys on the right-hand home row diverge from Vim’s HJKL order +because it feels more natural to follow the inward-rising curve of the keyboard’s +contoured keywell, which elevates the thumb above the pinky finger and, similarly, +the middle finger (up arrow) above the ring finger (down arrow).

                                                                                                                                                                    +

                                                                                                                                                                    This is a longstanding preference that I formed 17 years ago, in my early days of +using the Kinesis Advantage with the Dvorak layout, whose lack of HJKL provided +the freedom to reimagine the arrangement of arrow keys on the home row.

                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Select & edit

                                                                                                                                                                    +
                                                                                                                                                                    +

                                                                                                                                                                    Editing and selection keys line the outer edges of the home block, respectively. +This opposition enables inward rolls, where selections can be followed by edits. +For example, to copy everything, I would first tap the “Select all” key with my +pinky finger and then roll inward to tap the “Copy” key with my index finger.

                                                                                                                                                                    +

                                                                                                                                                                    The copy and paste keys are stacked vertically, in that order, to allow the index +finger to rake down upon them in a natural curling motion toward the palm. This +order is also logical, since pasting requires something to be copied first.

                                                                                                                                                                    +

                                                                                                                                                                    The versatile “Select word/line” key at the right edge of the home row is powered +by Pascal Getreuer’s word selection QMK macro, which automates common +selection tasks that require holding down Control and Shift with the arrow keys:

                                                                                                                                                                    + +
                                                                                                                                                                    +Video demonstration of Pascal Getreuer's word selection QMK macro
                                                                                                                                                                    +

                                                                                                                                                                    Tapping it selects the word under the cursor; shift-tapping it selects the line. +Further taps extend the selection by another word (unshifted) or line (shifted).

                                                                                                                                                                    + +

                                                                                                                                                                    Number layer

                                                                                                                                                                    +

                                                                                                                                                                    Diagram of the number layer. +

                                                                                                                                                                    +

                                                                                                                                                                    A 3x3 numeric keypad (using the standard 10-key layout) occupies the home block. +The period key is poised to be tapped using the metacarpal joint of the thumb, +allowing the thumb to rest on the zero key, ready for more numerical data entry.

                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Prefix signs

                                                                                                                                                                    +
                                                                                                                                                                    +

                                                                                                                                                                    Signs that commonly prefix numbers are positioned above the 3x3 numeric keypad.

                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • ~ approximately
                                                                                                                                                                    • +
                                                                                                                                                                    • $ dollar amount
                                                                                                                                                                    • +
                                                                                                                                                                    • # literal number
                                                                                                                                                                    • +
                                                                                                                                                                    • @ at the rate of
                                                                                                                                                                    • +
                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Date & time

                                                                                                                                                                    +
                                                                                                                                                                    +

                                                                                                                                                                    The slash and minus keys are positioned for MM/DD and YYYY-MM-DD date entry. +Similarly, the colon key is positioned above them for HH:MM:SS time stamp entry.

                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • : time stamp separator
                                                                                                                                                                    • +
                                                                                                                                                                    • - ISO-8601 date separator
                                                                                                                                                                    • +
                                                                                                                                                                    • / American date separator
                                                                                                                                                                    • +
                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Inequalities

                                                                                                                                                                    +
                                                                                                                                                                    +

                                                                                                                                                                    Comparison operators are positioned along the outer left edge of the home block.

                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • ~ approximately
                                                                                                                                                                    • +
                                                                                                                                                                    • < less than
                                                                                                                                                                    • +
                                                                                                                                                                    • > greater than
                                                                                                                                                                    • +
                                                                                                                                                                    • = equal to
                                                                                                                                                                    • +
                                                                                                                                                                    +

                                                                                                                                                                    The greater/equals keys are stacked vertically, in that order, to allow the +index finger to rake down upon them in a natural curling motion toward the palm.

                                                                                                                                                                    + +

                                                                                                                                                                    Function layer

                                                                                                                                                                    +

                                                                                                                                                                    Diagram of the function layer. +

                                                                                                                                                                    +

                                                                                                                                                                    The function keys are arranged in the same 10-key layout as the Number +layer’s 3x3 numeric keypad so that you can develop common muscle +memory for both layers. The remaining F10-F12 keys wrap around the home block +because they’re found in shortcuts such as BIOS save/quit, fullscreen toggle, +and devtools, respectively.

                                                                                                                                                                    + +

                                                                                                                                                                    Symbol layer

                                                                                                                                                                    +

                                                                                                                                                                    This is the crown jewel of my keyboard’s configuration: an entire layer dedicated +to the entry of symbols that are essential for computer programming. +It’s the result of several hundreds of layout iterations over the last 8+ years.

                                                                                                                                                                    +

                                                                                                                                                                    Diagram of the symbol layer. +

                                                                                                                                                                    + +
                                                                                                                                                                    +

                                                                                                                                                                    👉 +Red groups. +Blue quotes. +Yellow Vim. +Green arrows. +Purple flips.

                                                                                                                                                                    +
                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • \ is on the thumb for escaping all other symbols without moving your hand.
                                                                                                                                                                    • +
                                                                                                                                                                    • For snake_case, _ is at the same spot as English’s most frequent letter e.
                                                                                                                                                                    • +
                                                                                                                                                                    • For assignment, = is on the home row because it’s frequent in programming.
                                                                                                                                                                    • +
                                                                                                                                                                    • For strings, all quotation marks are located at the top of the home block.
                                                                                                                                                                    • +
                                                                                                                                                                    • Bitwise |& and arithmetic -+ operators “flap down” and “fold up” together.
                                                                                                                                                                    • +
                                                                                                                                                                    • Angling arrows ->, =>, ~>, <~, <=, <-, and plentiful pipes |>, <| abound!
                                                                                                                                                                    • +
                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Base layer affinity

                                                                                                                                                                    +
                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • @ is at the same relative position as the Tab key on standard keyboards. +They pair well: the former denotes references and the latter expands them.
                                                                                                                                                                    • +
                                                                                                                                                                    • ` is on the same key as ' on the base layer, for `' legacy curly quotes.
                                                                                                                                                                    • +
                                                                                                                                                                    • ! is on the same key as Shift on the base layer; both invert things.
                                                                                                                                                                    • +
                                                                                                                                                                    • : is on the same key as Esc on the base layer; they’re duals in Vim.
                                                                                                                                                                    • +
                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Vim editor shortcuts

                                                                                                                                                                    +
                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • ^ and $ are on the home row, for jumping to the beginning/end of line.
                                                                                                                                                                    • +
                                                                                                                                                                    • % is on the home row, for jumping to the matching delimiter at cursor.
                                                                                                                                                                    • +
                                                                                                                                                                    • # is on the home row, to search backwards for the word under cursor.
                                                                                                                                                                    • +
                                                                                                                                                                    • = is on the home row, to automatically indent the line or selection.
                                                                                                                                                                    • +
                                                                                                                                                                    • { and } are on the home block, for jumping to previous/next paragraph.
                                                                                                                                                                    • +
                                                                                                                                                                    • < and > are on the home block, for decreasing/increasing indentation.
                                                                                                                                                                    • +
                                                                                                                                                                    • : is on the inner thumb key, for entering Vim’s command mode.
                                                                                                                                                                    • +
                                                                                                                                                                    • ; is on the outer thumb key, for repeating a f/F/t/T character search.
                                                                                                                                                                    • +
                                                                                                                                                                    • * is on the thumb joint, to search forwards for the word under cursor.
                                                                                                                                                                    • +
                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Adjacent key bigrams

                                                                                                                                                                    +
                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • #! for shebang lines in UNIX scripts.
                                                                                                                                                                    • +
                                                                                                                                                                    • .* for regular expressions.
                                                                                                                                                                    • +
                                                                                                                                                                    • *. for filesystem globs.
                                                                                                                                                                    • +
                                                                                                                                                                    • () for parentheses.
                                                                                                                                                                    • +
                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Outer corner bigrams

                                                                                                                                                                    +
                                                                                                                                                                    +

                                                                                                                                                                    These are easy to find because they’re on the outer corners of the keyboard.

                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • !~ for regular expression “not matching” in Perl, Ruby, and Elixir.
                                                                                                                                                                    • +
                                                                                                                                                                    • /* and */ for multi-line comments in C, CSS, and JavaScript.
                                                                                                                                                                    • +
                                                                                                                                                                    • \/ for escaped regular expression delimiters in Vim.
                                                                                                                                                                    • +
                                                                                                                                                                    • ~/ for home directory paths in UNIX.
                                                                                                                                                                    • +
                                                                                                                                                                    • ?! for interrobang in English prose.
                                                                                                                                                                    • +
                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Inward rolling bigrams

                                                                                                                                                                    +
                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • <- for assignment in R and in Elixir’s with statements.
                                                                                                                                                                    • +
                                                                                                                                                                    • -> for thin arrows in C, C++, and Elixir.
                                                                                                                                                                    • +
                                                                                                                                                                    • => for fat arrows in Perl, Ruby, and Elixir.
                                                                                                                                                                    • +
                                                                                                                                                                    • =~ for regular expression matching in Perl, Ruby, and Elixir.
                                                                                                                                                                    • +
                                                                                                                                                                    • !~ for regular expression “not matching” in Perl, Ruby, and Elixir.
                                                                                                                                                                    • +
                                                                                                                                                                    • != for “not equal to” value comparison in many languages.
                                                                                                                                                                    • +
                                                                                                                                                                    • <= for “less than or equal to” comparison in many languages.
                                                                                                                                                                    • +
                                                                                                                                                                    • ^= for bitwise XOR assignment in C and related languages.
                                                                                                                                                                    • +
                                                                                                                                                                    • |> for the pipe operator in Elixir.
                                                                                                                                                                    • +
                                                                                                                                                                    • !( for negating a group in Boolean expressions.
                                                                                                                                                                    • +
                                                                                                                                                                    • "$ for quoted variable substitution in Bourne shell.
                                                                                                                                                                    • +
                                                                                                                                                                    • !$ for last argument of previous command in Bourne shell.
                                                                                                                                                                    • +
                                                                                                                                                                    • $? for exit status of previous command in Bourne shell.
                                                                                                                                                                    • +
                                                                                                                                                                    • <% for directive tags in Ruby’s ERB and Elixir’s EEx templates.
                                                                                                                                                                    • +
                                                                                                                                                                    • #{ for string interpolation in Ruby and Elixir.
                                                                                                                                                                    • +
                                                                                                                                                                    • #[ and ![ for metadata attributes in Rust.
                                                                                                                                                                    • +
                                                                                                                                                                    • `' for legacy curly quotes.
                                                                                                                                                                    • +
                                                                                                                                                                    • /? for query parameters in URLs.
                                                                                                                                                                    • +
                                                                                                                                                                    • /* for starting comments in C, CSS, and JavaScript.
                                                                                                                                                                    • +
                                                                                                                                                                    • [] for square brackets.
                                                                                                                                                                    • +
                                                                                                                                                                    • <> for angle brackets.
                                                                                                                                                                    • +
                                                                                                                                                                    • {} for curly braces.
                                                                                                                                                                    • +
                                                                                                                                                                    + +
                                                                                                                                                                    + +

                                                                                                                                                                    Outward rolling bigrams

                                                                                                                                                                    +
                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    • ~> for pessimistic version constraint in SemVer.
                                                                                                                                                                    • +
                                                                                                                                                                    • -= for negative accumulation in C and related languages.
                                                                                                                                                                    • +
                                                                                                                                                                    • += for accumulation in C and many languages.
                                                                                                                                                                    • +
                                                                                                                                                                    • %= for modulo assignment in C and related languages.
                                                                                                                                                                    • +
                                                                                                                                                                    • >= for “greater than or equal to” value comparison.
                                                                                                                                                                    • +
                                                                                                                                                                    • >& and &< for file descriptor redirection in Bourne shell.
                                                                                                                                                                    • +
                                                                                                                                                                    • $_ for value of last argument of previous command in Bourne shell.
                                                                                                                                                                    • +
                                                                                                                                                                    • %> for directive tags in Ruby’s ERB and Elixir’s EEx templates.
                                                                                                                                                                    • +
                                                                                                                                                                    • ${ for variable interpolation in Bourne shell.
                                                                                                                                                                    • +
                                                                                                                                                                    • %{ for maps (hash tables) in Elixir.
                                                                                                                                                                    • +
                                                                                                                                                                    • ~/ for home directory paths in UNIX.
                                                                                                                                                                    • +
                                                                                                                                                                    • */ for closing comments in C, CSS, and JavaScript.
                                                                                                                                                                    • +
                                                                                                                                                                    + +

                                                                                                                                                                    Mouse layer

                                                                                                                                                                    +

                                                                                                                                                                    Diagram of the mouse layer. +

                                                                                                                                                                    +

                                                                                                                                                                    Movement keys are located centrally in the home block, resembling WASD keys, and +mouse acceleration controls are poised for pinky finger access, so you can +independently move the mouse pointer and also change its speed at the same time.

                                                                                                                                                                    +

                                                                                                                                                                    Mousewheel down/up keys are also placed on the home block, specifically on +the same keys as J/K (down/up in Vim) on the base layer for muscle memory reuse.

                                                                                                                                                                    + +

                                                                                                                                                                    Light layer

                                                                                                                                                                    +

                                                                                                                                                                    Diagram of the light layer. +

                                                                                                                                                                    +

                                                                                                                                                                    Keys for lowering/raising light settings line the central columns of home block, +whereas keys for applying lighting modes line the outer edges of the home block.

                                                                                                                                                                    + +

                                                                                                                                                                    Firmware

                                                                                                                                                                    +

                                                                                                                                                                    My keyboard’s entire QMK firmware configuration, as described in this article, is +made available on GitHub in the sunaku_dm5x6 branch of my +personal QMK fork.

                                                                                                                                                                    +
                                                                                                                                                                    ~/qmk_firmware/keyboards/handwired/dactyl_manuform/5x6_5/keymaps/sunaku/
                                                                                                                                                                    +├── config.h
                                                                                                                                                                    +├── features -> getreuer/features
                                                                                                                                                                    +├── getreuer/
                                                                                                                                                                    +├── keymap_config.json
                                                                                                                                                                    +├── keymap_footer.c
                                                                                                                                                                    +├── keymap_header.c
                                                                                                                                                                    +├── Makefile
                                                                                                                                                                    +├── README.md
                                                                                                                                                                    +└── rules.mk
                                                                                                                                                                    +
                                                                                                                                                                    +

                                                                                                                                                                    Extra QMK patches

                                                                                                                                                                    +

                                                                                                                                                                    This configuration includes additional enhancements on top of the standard QMK:

                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    1. My crossover bilateral combinations patch, used for Miryoku home row mods.
                                                                                                                                                                    2. +
                                                                                                                                                                    3. Pascal Getreuer’s word selection QMK macro, utilized in the cursor layer.
                                                                                                                                                                    4. +
                                                                                                                                                                    + +

                                                                                                                                                                    QMK configurator app

                                                                                                                                                                    +

                                                                                                                                                                    You can upload the provided QMK Keymap JSON file named +keymap_config.json into the QMK Configurator app to view or +customize the keymap and all of its layers. When you’re finished, download the +keymap back to the same file, overwriting it.

                                                                                                                                                                    + +

                                                                                                                                                                    Building the firmware

                                                                                                                                                                    +

                                                                                                                                                                    Navigate into the directory shown in the Firmware section above and run make to:

                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    1. Convert the keymap_config.json file into C source code.
                                                                                                                                                                    2. +
                                                                                                                                                                    3. Wrap the C source code with a custom header and footer.
                                                                                                                                                                    4. +
                                                                                                                                                                    5. Compile the wrapped up C source code using qmk compile.
                                                                                                                                                                    6. +
                                                                                                                                                                    7. Flash the compiled firmware (HEX file) to the keyboard.
                                                                                                                                                                    8. +
                                                                                                                                                                    +

                                                                                                                                                                    All these steps are handled by the provided Makefile, shown below for reference:

                                                                                                                                                                    +
                                                                                                                                                                    # NOTE: Don't name the QMK Configurator JSON keymap file as "keymap.json"
                                                                                                                                                                    +# because `qmk compile` directly translates it into C and compiles it too,
                                                                                                                                                                    +# thereby completely bypassing this Makefile and our keymap header/footer!
                                                                                                                                                                    +
                                                                                                                                                                    +TOPLEVEL=`git rev-parse --show-toplevel`
                                                                                                                                                                    +KEYBOARD=handwired/dactyl_manuform/5x6_5
                                                                                                                                                                    +KEYMAP=sunaku
                                                                                                                                                                    +
                                                                                                                                                                    +all: flash
                                                                                                                                                                    +
                                                                                                                                                                    +flash: build
                                                                                                                                                                    +	    qmk flash -kb $(KEYBOARD) -km $(KEYMAP)
                                                                                                                                                                    +
                                                                                                                                                                    +build: keymap.c config.h rules.mk
                                                                                                                                                                    +	    test ! -e keymap.json # see comment at the top of this Makefile
                                                                                                                                                                    +	    qmk compile -kb $(KEYBOARD) -km $(KEYMAP)
                                                                                                                                                                    +
                                                                                                                                                                    +keymap.c: keymap_config.json keymap_header.c keymap_footer.c config.h
                                                                                                                                                                    +	    qmk json2c -o $@ $<
                                                                                                                                                                    +	    spot=$$( awk '/THIS FILE WAS GENERATED/ { print NR-1 }' $@ ) && \
                                                                                                                                                                    +	    sed -e "$$spot r keymap_header.c" -e "$$ r keymap_footer.c" -i $@
                                                                                                                                                                    +
                                                                                                                                                                    +clean:
                                                                                                                                                                    +	    qmk clean
                                                                                                                                                                    +
                                                                                                                                                                    +clobber: clean
                                                                                                                                                                    +	    rm -fv keymap.c
                                                                                                                                                                    +	    rm -fv $(TOPLEVEL)/$$( echo $(KEYBOARD) | tr / _ )_$(KEYMAP).hex
                                                                                                                                                                    +
                                                                                                                                                                    +.PHONY: clean clobber build flash
                                                                                                                                                                    +

                                                                                                                                                                    \ No newline at end of file diff --git a/darcs-2-enhances-amend-record.html b/darcs-2-enhances-amend-record.html new file mode 100644 index 0000000..457874e --- /dev/null +++ b/darcs-2-enhances-amend-record.html @@ -0,0 +1,36 @@ +Darcs 2 enhances amend-record - The Terminal Programmer

                                                                                                                                                                    Darcs 2 enhances amend-record

                                                                                                                                                                    Suraj N. Kurapati

                                                                                                                                                                    Version 2 of +Darcs, the “feel good” distributed version +control +system, was released recently. This +version includes a new feature that I long awaited for, and almost invented +my own version control system for:

                                                                                                                                                                    + +
                                                                                                                                                                    +

                                                                                                                                                                    The main lesson regarding these new semantics is that patches depends on +primitive patches, not on named patches. A named patch is really just a set +of primitive patches.

                                                                                                                                                                    +
                                                                                                                                                                    +

                                                                                                                                                                    To better understand this feature, consider this example:

                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    1. Patch X modifies files A, B, and C.
                                                                                                                                                                    2. +
                                                                                                                                                                    3. Patch Y modifies files A and C.
                                                                                                                                                                    4. +
                                                                                                                                                                    5. You modify file B and want to amend patch X.
                                                                                                                                                                    6. +
                                                                                                                                                                    +

                                                                                                                                                                    Darcs 2 allows this (hurray!) whereas Darcs 1 does not. As a result, you had +to go through a fair bit of manual labor to achieve the same effect in Darcs +1:

                                                                                                                                                                    + +
                                                                                                                                                                      +
                                                                                                                                                                    1. Create a temporary branch.
                                                                                                                                                                    2. +
                                                                                                                                                                    3. Unrecord patch Y.
                                                                                                                                                                    4. +
                                                                                                                                                                    5. Amend patch X.
                                                                                                                                                                    6. +
                                                                                                                                                                    7. Push the new patch X.
                                                                                                                                                                    8. +
                                                                                                                                                                    9. Recreate patch Y.
                                                                                                                                                                    10. +
                                                                                                                                                                    11. Finally, push patch Y.
                                                                                                                                                                    12. +
                                                                                                                                                                    +

                                                                                                                                                                    \ No newline at end of file diff --git a/darcs-migration-tailor-ascii-error.html b/darcs-migration-tailor-ascii-error.html new file mode 100644 index 0000000..3530431 --- /dev/null +++ b/darcs-migration-tailor-ascii-error.html @@ -0,0 +1,15 @@ +ASCII/Unicode error in Tailor - The Terminal Programmer

                                                                                                                                                                    ASCII/Unicode error in Tailor

                                                                                                                                                                    Suraj N. Kurapati

                                                                                                                                                                    When using Tailor to migrate from +Subversion to the Darcs distributed version control +system, I encountered an error saying:

                                                                                                                                                                    +
                                                                                                                                                                    'ascii' codec can't encode character
                                                                                                                                                                    +

                                                                                                                                                                    According to this Tailor bug +report, the solution is to +specify the --encoding=utf-8 option to Tailor. However, that did not work +for me. Instead, I had to change Python’s default system encoding, in the +/etc/python2.4/site.py file, from "ascii" to "utf-8" to solve the +problem.

                                                                                                                                                                    +

                                                                                                                                                                    \ No newline at end of file diff --git a/defining-methods-for-erb-templates.html b/defining-methods-for-erb-templates.html new file mode 100644 index 0000000..932711c --- /dev/null +++ b/defining-methods-for-erb-templates.html @@ -0,0 +1,26 @@ +Defining methods for ERB templates - The Terminal Programmer

                                                                                                                                                                    Defining methods for ERB templates

                                                                                                                                                                    Suraj N. Kurapati


                                                                                                                                                                    While converting ruby-vpi documentation from DocBook-XML to RedCloth, I +wanted an easy way to pass a bunch of text to my own methods, in a fashion +similar to if-statements and iterators. This would allow me to make +admonitions easily by writing code like the following in my ERB template.

                                                                                                                                                                    +
                                                                                                                                                                    <% caution do %>
                                                                                                                                                                    +Nothing is as it seems!
                                                                                                                                                                    +<% end %>
                                                                                                                                                                    +

                                                                                                                                                                    At first glance, it seems that the content between the do and end +keywords is just passed as a string inside the block argument to the +method. However, in truth, the block argument contains an expression that +appends the content between do and end to the _erbout variable, +like this:

                                                                                                                                                                    +
                                                                                                                                                                    _erbout << "Nothing is as it seems!"
                                                                                                                                                                    +

                                                                                                                                                                    ERB allows us to specify an alternate name for _erbout (its evaluation +buffer) in its constructor. We can use this ability to capture the content +passed from an ERB template to a Ruby method as follows.

                                                                                                                                                                    +

                                                                                                                                                                    TODO: finish this article!

                                                                                                                                                                    +

                                                                                                                                                                    Updates


                                                                                                                                                                    Readably written, Everforest colored.

                                                                                                                                                                    Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                    +
                                                                                                                                                                    \ No newline at end of file diff --git a/dwm-spawn-cwd-patch.html b/dwm-spawn-cwd-patch.html new file mode 100644 index 0000000..391c8a8 --- /dev/null +++ b/dwm-spawn-cwd-patch.html @@ -0,0 +1,92 @@ +Spawn from current working directory in DWM - The Terminal Programmer

                                                                                                                                                                    Spawn from current working directory in DWM

                                                                                                                                                                    Suraj N. Kurapati

                                                                                                                                                                    1. Problem
                                                                                                                                                                      1. Solution
                                                                                                                                                                        +

                                                                                                                                                                        Problem

                                                                                                                                                                        +

                                                                                                                                                                        I switched to DWM recently +after six productive years of WMII and one of the things I missed from my +previous WMII configuration was the ability to open new programs in the +currently focused client’s working directory.

                                                                                                                                                                        +

                                                                                                                                                                        Why? It’s all about spatial locality. For example, when I’m editing +in Vim, I like to start some new terminals (or file managers) in the same +working directory as the file I’m editing to do additional things. Or the +scenario could be the opposite: when I’m browsing the filesystem in a file +manager, I want to start Vim inside the directory I am currently browsing.

                                                                                                                                                                        +

                                                                                                                                                                        Without this feature, I have to manually navigate to that working +directory in each helper application (terminal, file manager, or editor) +that I launched. This becomes tiresome and inefficient as time goes on.

                                                                                                                                                                        +

                                                                                                                                                                        Thus, to correct this imbalance and regain my productivity, I dusted off +my C knowledge and ported this feature to DWM using just 27 +statement-lines of code (SLOC), as you can see in the patch below.

                                                                                                                                                                        + +

                                                                                                                                                                        Solution

                                                                                                                                                                        +

                                                                                                                                                                        This patch is also available on GitHub.

                                                                                                                                                                        +
                                                                                                                                                                        diff --git a/dwm.c b/dwm.c
                                                                                                                                                                        +index 1d78655..156ee60 100644
                                                                                                                                                                        +--- a/dwm.c
                                                                                                                                                                        ++++ b/dwm.c
                                                                                                                                                                        +@@ -20,6 +20,7 @@
                                                                                                                                                                        +  *
                                                                                                                                                                        +  * To understand everything else, start reading main().
                                                                                                                                                                        +  */
                                                                                                                                                                        ++#include <assert.h>
                                                                                                                                                                        + #include <errno.h>
                                                                                                                                                                        + #include <locale.h>
                                                                                                                                                                        + #include <stdarg.h>
                                                                                                                                                                        +@@ -28,6 +29,8 @@
                                                                                                                                                                        + #include <stdlib.h>
                                                                                                                                                                        + #include <string.h>
                                                                                                                                                                        + #include <unistd.h>
                                                                                                                                                                        ++#include <libgen.h>
                                                                                                                                                                        ++#include <sys/stat.h>
                                                                                                                                                                        + #include <sys/types.h>
                                                                                                                                                                        + #include <sys/wait.h>
                                                                                                                                                                        + #include <X11/cursorfont.h>
                                                                                                                                                                        +@@ -1661,11 +1664,45 @@ sigchld(int unused) {
                                                                                                                                                                        +  while(0 < waitpid(-1, NULL, WNOHANG));
                                                                                                                                                                        + }
                                                                                                                                                                        +
                                                                                                                                                                        ++#define SPAWN_CWD_DELIM " []{}()<>\"':"
                                                                                                                                                                        ++
                                                                                                                                                                        + void
                                                                                                                                                                        + spawn(const Arg *arg) {
                                                                                                                                                                        +  if(fork() == 0) {
                                                                                                                                                                        +    if(dpy)
                                                                                                                                                                        +      close(ConnectionNumber(dpy));
                                                                                                                                                                        ++       if(selmon->sel) {
                                                                                                                                                                        ++           const char* const home = getenv("HOME");
                                                                                                                                                                        ++           assert(home && strchr(home, '/'));
                                                                                                                                                                        ++           const size_t homelen = strlen(home);
                                                                                                                                                                        ++           char *cwd, *pathbuf = NULL;
                                                                                                                                                                        ++           struct stat statbuf;
                                                                                                                                                                        ++
                                                                                                                                                                        ++           cwd = strtok(selmon->sel->name, SPAWN_CWD_DELIM);
                                                                                                                                                                        ++           /* NOTE: strtok() alters selmon->sel->name in-place,
                                                                                                                                                                        ++            * but that does not matter because we are going to
                                                                                                                                                                        ++            * exec() below anyway; nothing else will use it */
                                                                                                                                                                        ++           while(cwd) {
                                                                                                                                                                        ++               if(*cwd == '~') { /* replace ~ with $HOME */
                                                                                                                                                                        ++                   if(!(pathbuf = malloc(homelen + strlen(cwd)))) /* ~ counts for NULL term */
                                                                                                                                                                        ++                       die("fatal: could not malloc() %u bytes\n", homelen + strlen(cwd));
                                                                                                                                                                        ++                   strcpy(strcpy(pathbuf, home) + homelen, cwd + 1);
                                                                                                                                                                        ++                   cwd = pathbuf;
                                                                                                                                                                        ++               }
                                                                                                                                                                        ++
                                                                                                                                                                        ++               if(strchr(cwd, '/') && !stat(cwd, &statbuf)) {
                                                                                                                                                                        ++                   if(!S_ISDIR(statbuf.st_mode))
                                                                                                                                                                        ++                       cwd = dirname(cwd);
                                                                                                                                                                        ++
                                                                                                                                                                        ++                   if(!chdir(cwd))
                                                                                                                                                                        ++                       break;
                                                                                                                                                                        ++               }
                                                                                                                                                                        ++
                                                                                                                                                                        ++               cwd = strtok(NULL, SPAWN_CWD_DELIM);
                                                                                                                                                                        ++           }
                                                                                                                                                                        ++
                                                                                                                                                                        ++           free(pathbuf);
                                                                                                                                                                        ++       }
                                                                                                                                                                        +    setsid();
                                                                                                                                                                        +    execvp(((char **)arg->v)[0], (char **)arg->v);
                                                                                                                                                                        +    fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]);
                                                                                                                                                                        +

                                                                                                                                                                        \ No newline at end of file diff --git a/ebola-virus.html b/ebola-virus.html new file mode 100644 index 0000000..20b9741 --- /dev/null +++ b/ebola-virus.html @@ -0,0 +1,91 @@ +Investigating the Ebola HF virus - The Terminal Programmer

                                                                                                                                                                        Investigating the Ebola HF virus

                                                                                                                                                                        Suraj N. Kurapati

                                                                                                                                                                        1. References

                                                                                                                                                                          Ebola HF is a type of VHF (viral hemorrhagic fever) that is only found in +Africa. This virus is zoonotic, which means it stays on an animal host until +it is passed onto another host. The Ebola HF virus belongs to a family of +viruses called Filoviridae which divides up into four known strains: Ebola +Zaire, Ebola Sudan, Ebola Ivory Coast, and Ebola Reston [1]. All four strains +have no vaccination, and still claim victims in isolated areas of Africa such +as Gabon, Sudan, and Zaire (also known as The Democratic Republic of the +Congo). When cynomolgous monkeys infected with Ebola Reston were shipped from +the Philippines to the United States and Italy for research, an outbreak +occurred and some researchers were exposed to the virus. Fortunately the Ebola +Reston did not affect humans, but it did affect the cynomolgous monkeys and +other primates.

                                                                                                                                                                          +

                                                                                                                                                                          Although the natural reservoir (the place Ebola HF originated from) of Ebola +HF is unknown, the virus was first found in 1976 in the small Bandundu +province near the Ebola River in Zaire (now known as The Democratic Republic +of the Congo). In this first outbreak, the number of deaths among the 318 +infected people (Ebola Zaire) was 88% [2]. Later that year another smaller +breakout occurred in Southern Sudan where 53% of the 284 infected people +(Ebola Sudan) died [3].

                                                                                                                                                                          +

                                                                                                                                                                          The process of being infected by the Ebola HF virus from another person has +yet to be understood, but the symptoms and ways of transmission of the disease +are known. During the first few days of infection, most patients will have +fevers, joint pains, and diarrhea. Some patients will have sore throat, skin +rashes; bloody diarrhea, red and itchy eyes, and hiccups. During the last days +of infection, most patients will have chest pain, and shock. Some patients +become blind and bleed in their digestive tract in the last hours of their +life.

                                                                                                                                                                          +

                                                                                                                                                                          Transmitting the virus between humans requires some person has to have touched +an animal carrying the virus. Then that person would go and touch his family +and friends, and so on. Some common ways of transferring the virus from person +to person are: touching and handling used needles with bodily liquids still on +them, touching any bodily liquids of the carrier, touching dead victims, +touching infected people’s bleeding wounds or skin rashes, and even touching +or wearing their clothes.

                                                                                                                                                                          +

                                                                                                                                                                          In the fight for a cure for Ebola HF, several procedures were created to +identify the disease in patients. The lgG ELISA (Antigen-Capture-Enzyme- +Linked-Immunosorbent Assay) laboratory procedure is used to test patients for +virus infection [4]. This specific procedure is a part of a pathogen testing +protocol called ELISA (Enzyme-Linked-Immunosorbent Serologic Assay) [4]. It +detects specific substances such as viruses, pathogens, and other infectious +disease. There are no developed vaccines for any strain of Ebola HF virus, but +there are many people who have survived the disease. The disease can be +prevented if people are careful around needles, and dead victims, and if they +are infected, they should see the doctor right away for the lgG ELISA +procedure. There are a few cases of success, for example, in Kikwit, Zairevii +in 1995, seven out of eight infected patients lived when they were given blood +from patients who had survived the disease. This data seems promising, but +there were too few people to experiment with, and each person had his/her own +qualities which could have greatly affected his/her outcome. For this reason, +this data was considered useless by the CDC9.

                                                                                                                                                                          +

                                                                                                                                                                          According to the CDC [6], African health-care facilities are not the best +places to get help for an Ebola HF infection. Patients are often cared for +without protection such as masks and gloves, and they are exposed to the same +clothes that physicians wear while treating those who are dying. Needles and +syringes are not sterilized or thrown away; instead they are simply rinsed +with water and reused again. For example, a blood sample would be taken from a +dying person, and then the needle would be rinsed and used to inject into a +vial of medicine into another person. I think it is naive that these +physicians look past such simple things as sterilization. They are infecting +more people rather than saving them [5].

                                                                                                                                                                          +

                                                                                                                                                                          The African health-care facilities need more attention from world +organizations such as the Red Cross, CARE, and the CDCix. People need to be +aware of the conditions in these facilities so we can help the facilities +incorporate standard sterilization procedures. This will significantly reduce +the number of deaths due to bio-hazardous medical equipment. The facilities +and these organizations can also invoke public support, to raise money, and +get food for those suffering from the disease and their families. Also, if +more biotechnology and pharmaceutical companies invest in medical research +they could greatly profit; this will give the researchers funding so they can +start work on finding a cure for the disease.

                                                                                                                                                                          +

                                                                                                                                                                          I believe that the African health-care facilities need to incorporate standard +sterilization techniques before caring for patients. The Ebola HF virus needs +to be further researched so that a cure can be found. And people of the world +need to be more aware of this disease. After all, those who are suffering are +human, and if we don’t help them survive, who will be left to help us?

                                                                                                                                                                          + +

                                                                                                                                                                          References

                                                                                                                                                                          + +
                                                                                                                                                                            +
                                                                                                                                                                          1. Centers for Disease Control and Prevention. “CDC: SPB: Disease Information: Fact Sheets: Ebola Hemorrhagic Fever.” Available at: http://www.cdc.gov/ncidod/dvrd/spb/mnpages/dispages/ebola.htm. Accessed December 18, 2000.

                                                                                                                                                                          2. +
                                                                                                                                                                          3. University of Cape Town. “Management of Patients with Suspected Viral Hemorrhagic Fever.” Available at: http://www.uct.ac.za/microbiology/MMWR37s3.html. Accessed December 18, 2000.

                                                                                                                                                                          4. +
                                                                                                                                                                          5. Center for Disease Control and Prevention. “CDC: SPB: Disease Information: Fact Sheets: Ebola: Case Table.” Available at http://www.cdc.gov/ncidod/dvrd/spb/mnpages/dispages/ebotabl.htm. Accessed December 18, 2000.

                                                                                                                                                                          6. +
                                                                                                                                                                          7. Centers for Disease Control and Prevention. “CDC: SPB: Glossary of Terms.” Available at: http://www.cdc.gov/ncidod/dvrd/spb/mnpages/glossary.htm. Accessed December 18, 2000.

                                                                                                                                                                          8. +
                                                                                                                                                                          9. New England Journal of Medicine. “OnHealth: Ebola Virus Spreading throughout Cyberspace.” Available at: http://onhealth.webmd.com/conditions/in-depth/item/item%2C1921_1_1.asp. Accessed December 18, 2000.

                                                                                                                                                                          10. +
                                                                                                                                                                          11. Centers for Disease Control and Prevention. “MARBURG AND EBOLA VIRUSES.” Encyclopedia of Virology Plus CD-ROM. © 1995 Academic Press Ltd. All Rights Reserved.

                                                                                                                                                                          12. +
                                                                                                                                                                          +

                                                                                                                                                                          \ No newline at end of file diff --git a/educ92a-essay.html b/educ92a-essay.html new file mode 100644 index 0000000..71ebd80 --- /dev/null +++ b/educ92a-essay.html @@ -0,0 +1,156 @@ +Forced assimilation in American public education - The Terminal Programmer

                                                                                                                                                                          Forced assimilation in American public education

                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                          1. Priority
                                                                                                                                                                            1. Language
                                                                                                                                                                              1. Appearance
                                                                                                                                                                                1. Demeanor
                                                                                                                                                                                  1. Conclusion
                                                                                                                                                                                    1. References

                                                                                                                                                                                      American public education, both today and in contemporary times, has not +functioned without some degree of forced assimilation; that is, it has catered +specifically to the dominant culture in America while forcibly assimilating +students who represent the ethnic or socio-economic minority.

                                                                                                                                                                                      +

                                                                                                                                                                                      These are the results of a crude implementation of some of the chief ideals of +public education: to foster community [4] and “national unity” [5]. So to +better implement these ideals, the public education system in America must +focus on promoting “ethno-cultural unity” [5] as a way to achieve “national +unity” [5] rather than forcing assimilation, which imparts disunity.

                                                                                                                                                                                      + +

                                                                                                                                                                                      Priority

                                                                                                                                                                                      +

                                                                                                                                                                                      The concept of assimilation is primarily a concern for the minority, as it is +they who undergo the process firsthand. That is, the minority student feels a +sense of disconnection in the school environment due to differences in +language, appearance, and social norms of demeanor. In contrast, assimilation +does not affect the dominant culture as much, because schools are run by its +members and schools serve to promote its values and ideas. Thus the dominant +culture usually sees no problems in the education system and is apathetic +towards the concerns of minorities [2]. This also fuels opposition to changes +in the education system whereby the dominant culture feels that:

                                                                                                                                                                                      + +
                                                                                                                                                                                      +

                                                                                                                                                                                      The system suits me just fine, because it represents my way of life; why +then, shall I change it? The minority students should adopt these values +because they are good, and having done so will assist them in being successful +the workplace.

                                                                                                                                                                                      +
                                                                                                                                                                                      +

                                                                                                                                                                                      Obviously, such a viewpoint is wholly single-minded and crudely justifies the +teaching methods utilized by the education system:

                                                                                                                                                                                      + +
                                                                                                                                                                                        +
                                                                                                                                                                                      • Which values are “good” and which are not?
                                                                                                                                                                                      • +
                                                                                                                                                                                      • What is “successful” behavior and what is not?
                                                                                                                                                                                      • +
                                                                                                                                                                                      +

                                                                                                                                                                                      It is unjust for the dominant culture to simply dismiss the concerns of +minorities, since we live in a democratic [4] society. Thus the answer can be +obtained most fairly if all groups understand each-other’s needs and +priorities, i.e. there must be diversity, which fuels an interpenetration of +cultural understanding [4], in order to improve our education system.

                                                                                                                                                                                      + +

                                                                                                                                                                                      Language

                                                                                                                                                                                      +

                                                                                                                                                                                      A lack of fluency in dominant culture’s language can be the biggest +contributor in the concern of forced assimilation, as the majority of classes +taught in schools, save foreign language classes, are in English. A student +who lacks fluency in English may feel isolated from their peers and their +teachers.

                                                                                                                                                                                      +

                                                                                                                                                                                      For example, Richard Rodriguez writes that as a result of him becoming fluent +in English, he had lost confidence in speaking Spanish, which to him was +associated with closeness with his family and relatives [3]. Thus he felt +guilty for leaving behind his native language only to become “successful” +within the dominant culture [3].

                                                                                                                                                                                      +

                                                                                                                                                                                      Furthermore, the American public education system often flags the difficulty +in learning English as a “deficiency,” and industriously places minority +students into lower-track classes [2]. This further segregates minority +students from receiving high-track education [2] as they are made to think +that they are unqualified to achieve the “good” or valued positions in the +dominant society.

                                                                                                                                                                                      +

                                                                                                                                                                                      For example, when Malcolm X, a brilliant student, is asked to describe his +future ambitions by his English teacher, he replies that he aspires to become +a lawyer. In response his teacher suggests that his aspiration is not +“realistic” [1] and he should aim to become a carpenter instead [1].

                                                                                                                                                                                      + +

                                                                                                                                                                                      Appearance

                                                                                                                                                                                      +

                                                                                                                                                                                      The appearance of students is strictly controlled in public schools, more +so in the past than today, but nevertheless in favor of the dominant +culture. For example, Malcolm X “conks” (to straighten one’s hair by +incinerating the scalp with lye) his natural hair in order to make it +appear more like that of the dominant culture’s valued hair [1]. He later +describes this act as his “first really big step towards self degradation” +[1]. Through school dress- codes and images of popular media, the dominant +culture imposes its valued image of a “beautiful” person upon the masses.

                                                                                                                                                                                      +

                                                                                                                                                                                      For example, before I emigrated to America, I had never seen an “black” nor +“white” person, i.e. there was no institutionalized sense of “race.” However, +after several years of residence, I noticed that I favored images of “white” +people over those of “black” ones. More specifically, I favored the straight +hair over “corn-rows” or “du-rags” that many people wear in recent times. I +was shocked! How is it that I, who had no prior knowledge, bias, nor prejudice +towards any of these people, became to favor one over the other? This is due +to my subconscious being bombarded with ideas of what is “beautiful” and what +is not: the images I saw on television, cinemas, and daily life in public +schools.

                                                                                                                                                                                      +

                                                                                                                                                                                      Furthermore, if a school has a dress-code which enforces a certain kind of +clothing to be worn, it may further alienate minority students. For example, +if students were not allowed to wear any head decorations, i.e. hats, when +they recited the national anthem so as to give respect to “the flag,” then +minority students may not comply. If the school forces the removal of such +head decorations, then a Sikh student, who wears a turban, would certainly +feel humiliated and violated to have been forced to remove his turban. It is +equivalent to violating a person’s universal human rights, such as denying +them the right of clothing. In such a situation, the student who does not +remove their head decorations becomes alienated from the rest, for the student +appears to lack patriotism and may thus be interpreted as some form of a +heretic. Also, if the school’s administrators are not understanding of the +minority student’s situation, they may brashly expel them or move them into a +lower track [2].

                                                                                                                                                                                      + +

                                                                                                                                                                                      Demeanor

                                                                                                                                                                                      +

                                                                                                                                                                                      Alongside the troubles of assimilating with dominant language is that of the +social norms of demeanor. One is, in many ways, subtly outcast from the +dominant society if one does not exercise the mannerisms that the dominant +culture expects.

                                                                                                                                                                                      +

                                                                                                                                                                                      For example, in my culture, one does not openly address nor speak with others +with whom one is not acquainted with. However, now in America, every morning +as I am walking to class, somebody will greet me with the words “good +morning.” Upon hearing this I become very uncomfortable, almost +claustrophobic, as I must respond to them for the sake of not insulting them. +It is like being coerced to perform under the spotlight of a large opera hall. +Sometimes I simply nod and carry on, but I feel guilty to have offended the +other person. Of course, it may not be of such importance to those of the +dominant culture, as it is their natural and customary way of greeting others.

                                                                                                                                                                                      +

                                                                                                                                                                                      I also find it difficult to forge meaningful relationships with others, +especially when meeting someone new. For example, in America, one often says +“it was nice to meet you,” when one departs with someone. However, in my mind +these words are extremely superficial, for I feel that the other person is +simply uttering this dialogue for the sake of their own demeanor and has +embodied no true feelings in their message. In this manner, I feel as though +disjoint from my peers for I cannot accurately gauge the depth of their +dialogue or gestures. I feel as though it is inevitable for one to assimilate +with the dominant culture in order to survive; this message weighs heavily, in +my opinion, in the minds of minority students as they step out of their homes +and into the world of dominant culture, outside.

                                                                                                                                                                                      + +

                                                                                                                                                                                      Conclusion

                                                                                                                                                                                      +

                                                                                                                                                                                      Considering the clashes between the dominant culture and those of minorities, +I feel that the education system is trying to promote “national unity” [5] by +forcing it upon students and ignoring “ethno-cultural unity” [5], whereas it +would be more effective to gain “national unity” [5] through the promotion of +“ethno-cultural unity” [5].

                                                                                                                                                                                      +

                                                                                                                                                                                      In this manner, students can be better connected to and gain a deeper +understanding of each-other, which facilitates the formation of relationships. +These relationships form from an interpenetration of needs and wants which is +found in a community. Having developed such a community, we observe the +process of “socioendosmosis” [4], which in turn promotes “national unity” [5].

                                                                                                                                                                                      +

                                                                                                                                                                                      Thus the key to “national unity” [5] is not the propagation of the dominant +mono-culture, but rather in diversification of our public schools and +institutions.

                                                                                                                                                                                      + +

                                                                                                                                                                                      References

                                                                                                                                                                                      +

                                                                                                                                                                                      (cited in IEEE format)

                                                                                                                                                                                      + +
                                                                                                                                                                                        +
                                                                                                                                                                                      1. M. X, “Mascot,” in The Evolution of Education, D. Swanger, Eds. Ohio: Thomson Learning Custom Publishing, 2002. pp. 260-274.

                                                                                                                                                                                      2. +
                                                                                                                                                                                      3. J. Oakes, “The Distribution of Knowledge,” in The Evolution of Education, D. Swanger, Eds. Ohio: Thomson Learning Custom Publishing,

                                                                                                                                                                                        + +
                                                                                                                                                                                          +
                                                                                                                                                                                        1. pp. 305-336.
                                                                                                                                                                                        2. +
                                                                                                                                                                                      4. +
                                                                                                                                                                                      5. R. Rodriguez, “Aria,” in The Evolution of Education, D. Swanger, Eds. Ohio: Thomson Learning Custom Publishing, 2002. pp. 378-386.

                                                                                                                                                                                      6. +
                                                                                                                                                                                      7. J. Dewey, “Labor and Leisure,” in The Evolution of Education, D. Swanger, Eds. Ohio: Thomson Learning Custom Publishing, 2002. pp. 51-60.

                                                                                                                                                                                      8. +
                                                                                                                                                                                      9. D. Swanger, “The Evolution of Education.” Ohio: Thomson Learning Custom Publishing, 2002.

                                                                                                                                                                                      10. +
                                                                                                                                                                                      +

                                                                                                                                                                                      \ No newline at end of file diff --git a/elixir-fileio-speedup.html b/elixir-fileio-speedup.html new file mode 100644 index 0000000..65d44b7 --- /dev/null +++ b/elixir-fileio-speedup.html @@ -0,0 +1,112 @@ +Speeding up I/O on very large files in Elixir - The Terminal Programmer

                                                                                                                                                                                      Speeding up I/O on very large files in Elixir

                                                                                                                                                                                      Suraj N. Kurapati


                                                                                                                                                                                      1. Problem
                                                                                                                                                                                        1. Approach
                                                                                                                                                                                          1. Solution
                                                                                                                                                                                            1. Conclusion
                                                                                                                                                                                              +

                                                                                                                                                                                              Problem

                                                                                                                                                                                              +

                                                                                                                                                                                              At work today, a colleague needed to process a very large (1.5 GiB) log file, +line by line, using Elixir 1.4.2 and Erlang 19.2 on Linux 3.16. A simple iex +experiment yielded abysmal performance, taking 8 hours and 7 minutes to finish!

                                                                                                                                                                                              +
                                                                                                                                                                                              file = "path/to/very/large/file"
                                                                                                                                                                                              +lines = file |> File.stream!
                                                                                                                                                                                              +grep = lines |> Enum.filter(&String.match?(&1, ~r/regex_to_grep/))
                                                                                                                                                                                              +

                                                                                                                                                                                              In contrast, a similar experiment in Python 2.7.8 finished in merely 4 seconds:

                                                                                                                                                                                              +
                                                                                                                                                                                              import re
                                                                                                                                                                                              +regex_to_grep = re.compile('regex_to_grep')
                                                                                                                                                                                              +file = open('path/to/very/large/file', 'r')
                                                                                                                                                                                              +grep = [line for line in file if regex_to_grep.search(line)]
                                                                                                                                                                                              +
                                                                                                                                                                                              +

                                                                                                                                                                                              Approach

                                                                                                                                                                                              +

                                                                                                                                                                                              My first instinct was to parallelize the grep operation, but that didn’t help:

                                                                                                                                                                                              +
                                                                                                                                                                                              file = "path/to/very/large/file"
                                                                                                                                                                                              +lines = file |> File.stream!
                                                                                                                                                                                              +grep = lines |>
                                                                                                                                                                                              +  Task.async_stream(&(String.match?(&1, ~r/regex_to_grep/) and &1)) |>
                                                                                                                                                                                              +  Stream.map(fn {:ok, async_stream_result} -> async_stream_result end) |>
                                                                                                                                                                                              +  Enum.filter(&is_binary/1)
                                                                                                                                                                                              +

                                                                                                                                                                                              Surprised, I retreated back to a simple loop over the entire length of the file:

                                                                                                                                                                                              +
                                                                                                                                                                                              file = "path/to/very/large/file"
                                                                                                                                                                                              +lines = file |> File.stream!
                                                                                                                                                                                              +num_lines = lines |> Enum.count
                                                                                                                                                                                              +

                                                                                                                                                                                              Inconceivably, it hung again! So I now suspected that something might be wrong +with that log file itself. Paging through it, I discovered an enormous sequence +of NUL bytes embalmed several thousand lines deep. That was unexpected, but why +should NUL bytes only affect Elixir and not Python? Were C programs immune too?

                                                                                                                                                                                              +
                                                                                                                                                                                              $ grep -c 'regex_to_grep' path/to/very/large/file
                                                                                                                                                                                              +grep: line too long
                                                                                                                                                                                              +

                                                                                                                                                                                              Aha! GNU Grep actually had a safeguard built-in to prevent memory exploitation +by aborting on very long lines, likely elongated by that enormous NUL sequence.

                                                                                                                                                                                              +

                                                                                                                                                                                              Perhaps excessive line lengths also paralyzed Elixir? To verify, I wrote my +own file reader that would lazily read a single 128 KiB (32 filesystem blocks, +commonly sized to be 4 KiB) sized chunk at a time and then split it into lines:

                                                                                                                                                                                              +
                                                                                                                                                                                              file = "path/to/very/large/file"
                                                                                                                                                                                              +lines = file |> File.stream!([], 32 * 4096) |>
                                                                                                                                                                                              +  Stream.map(&String.split(&1, ~r/(?<=\n)/)) |>
                                                                                                                                                                                              +  Stream.transform("", fn lines, acc ->
                                                                                                                                                                                              +    if Enum.empty?(lines) do
                                                                                                                                                                                              +      if acc == "" do
                                                                                                                                                                                              +        {:halt, acc}
                                                                                                                                                                                              +      else
                                                                                                                                                                                              +        {[acc], ""}
                                                                                                                                                                                              +      end
                                                                                                                                                                                              +    else
                                                                                                                                                                                              +      # prepend previous partial line to this chunk
                                                                                                                                                                                              +      [first_line | rest_lines] = lines
                                                                                                                                                                                              +      lines = [acc <> first_line | rest_lines]
                                                                                                                                                                                              +      acc = ""
                                                                                                                                                                                              +
                                                                                                                                                                                              +      # carry any partial line at end of this chunk
                                                                                                                                                                                              +      unless List.last(lines) |> String.ends_with?("\n") do
                                                                                                                                                                                              +        {lines, [acc]} = Enum.split(lines, -1)
                                                                                                                                                                                              +      end
                                                                                                                                                                                              +
                                                                                                                                                                                              +      {lines, acc}
                                                                                                                                                                                              +    end
                                                                                                                                                                                              +  end)
                                                                                                                                                                                              +num_lines = lines |> Enum.count
                                                                                                                                                                                              +

                                                                                                                                                                                              This workaround successfully prevented the enormous NUL byte sequence from +hanging Elixir (hurray!) but the overall operation took 24 minutes to complete.

                                                                                                                                                                                              +

                                                                                                                                                                                              How do I optimize this further? Well, I would imagine that Elixir already uses +a similar (in spirit) line splitting algorithm that is already heavily optimized, +so eliminating my own would be ideal (deleted code is debugged code). In +addition, I also have control over the sizing of chunks I read from the file.

                                                                                                                                                                                              + +

                                                                                                                                                                                              Solution

                                                                                                                                                                                              +

                                                                                                                                                                                              Following this intuition, I searched the web and unearthed two disparate hints:

                                                                                                                                                                                              + +
                                                                                                                                                                                                +
                                                                                                                                                                                              1. Use IO.binstream/2 to read the file as a raw byte sequence (not as UTF-8, +which is the case with IO.stream/2 and thus with File.stream!/2 as well). +http://stackoverflow.com/a/31397000

                                                                                                                                                                                              2. +
                                                                                                                                                                                              3. Ask for large chunks while reading the file to counteract the overhead of +:file.read/2 and use additional buffering on top of it for performance. +http://stackoverflow.com/a/9771547

                                                                                                                                                                                              4. +
                                                                                                                                                                                              +

                                                                                                                                                                                              Applying these hints yielded 16x speedup, cutting execution time to 90 +seconds:

                                                                                                                                                                                              +
                                                                                                                                                                                              file = "path/to/very/large/file"
                                                                                                                                                                                              +io = file |> File.open!(read_ahead: 128 * 1024) # 128 KiB generous caching
                                                                                                                                                                                              +lines = io |> IO.binstream(:line)
                                                                                                                                                                                              +num_lines = lines |> Enum.count
                                                                                                                                                                                              +

                                                                                                                                                                                              That’s actually good performance, since wc took 74 seconds to count characters:

                                                                                                                                                                                              +
                                                                                                                                                                                              $ time wc path/to/very/large/file
                                                                                                                                                                                              + 92474     498826 1603770580 path/to/very/large/file
                                                                                                                                                                                              +wc path/to/very/large/file  73.57s user 0.84s system 100% cpu 1:14.41 total
                                                                                                                                                                                              +

                                                                                                                                                                                              Although this performance still pales in comparison to Python’s 4 seconds, it’s +a reasonable trade-off considering the concurrency and fault-tolerance merits of +Elixir over Python. Furthermore, this subpar performance might be a remnant of +the underlying algorithms being used to fill buffers and split lines inside Elixir, +given the similarity in execution time with wc when counting characters.

                                                                                                                                                                                              + +

                                                                                                                                                                                              Conclusion

                                                                                                                                                                                              +

                                                                                                                                                                                              Read large files as raw binary streams (not as UTF-8) along with enough caching:

                                                                                                                                                                                              +
                                                                                                                                                                                              file = "path/to/very/large/file"
                                                                                                                                                                                              +io = file |> File.open!(read_ahead: 128 * 1024) # 128 KiB generous caching
                                                                                                                                                                                              +lines = io |> IO.binstream(:line)
                                                                                                                                                                                              +

                                                                                                                                                                                              Updates


                                                                                                                                                                                              Readably written, Everforest colored.

                                                                                                                                                                                              Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                              +
                                                                                                                                                                                              \ No newline at end of file diff --git a/elixir-parallel-grep.html b/elixir-parallel-grep.html new file mode 100644 index 0000000..b46582a --- /dev/null +++ b/elixir-parallel-grep.html @@ -0,0 +1,98 @@ +A parallel grep(1) prototype in Elixir - The Terminal Programmer

                                                                                                                                                                                              A parallel grep(1) prototype in Elixir

                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                              +

                                                                                                                                                                                              Note: This all happened a year ago. I’m just late in writing about it.

                                                                                                                                                                                              +
                                                                                                                                                                                              +

                                                                                                                                                                                              A colleague needed a way to quickly grep(1) through several terabytes of +plain text reports at work today, so I wrote a basic prototype of parallel +grep(1) in Elixir during my lunch break. Its performance, to my surprise, +was astonishing!

                                                                                                                                                                                              +
                                                                                                                                                                                              $ cat search.exs
                                                                                                                                                                                              +defmodule Search do
                                                                                                                                                                                              +  def launch(regex, files) do
                                                                                                                                                                                              +    files |> Stream.reject(&File.dir?/1) |> Enum.map(fn file ->
                                                                                                                                                                                              +      spawn(__MODULE__, :search, [regex, file, self])
                                                                                                                                                                                              +    end)
                                                                                                                                                                                              +  end
                                                                                                                                                                                              +
                                                                                                                                                                                              +  def search(regex, file, receiver) do
                                                                                                                                                                                              +    file |> File.stream! |> Enum.each(fn line ->
                                                                                                                                                                                              +      case Regex.run(regex, line) do
                                                                                                                                                                                              +        nil -> ; # line didn't match so ignore it
                                                                                                                                                                                              +        matches -> send receiver, {file, matches}
                                                                                                                                                                                              +      end
                                                                                                                                                                                              +    end)
                                                                                                                                                                                              +  end
                                                                                                                                                                                              +
                                                                                                                                                                                              +  def results(count\\0) do
                                                                                                                                                                                              +    receive do
                                                                                                                                                                                              +      _result -> results(count+1) # consume the message and loop again
                                                                                                                                                                                              +      after 1000 -> IO.puts "got #{count} results; no more in last 1s"
                                                                                                                                                                                              +    end
                                                                                                                                                                                              +  end
                                                                                                                                                                                              +end
                                                                                                                                                                                              +
                                                                                                                                                                                              +[pattern|files] = System.argv
                                                                                                                                                                                              +regex = Regex.compile!(pattern)
                                                                                                                                                                                              +Search.launch(regex, files)
                                                                                                                                                                                              +Search.results
                                                                                                                                                                                              +

                                                                                                                                                                                              Extracting lines, along with capture groups, that matched a Perl-compatible +regular expression from a small sample of 17GB of plain text reports took +19 seconds for the prototype (note that it waits for an extra second +after finding the last search result), compared to 1 minute and 50 +seconds for GNU grep 2.5.1:

                                                                                                                                                                                              +
                                                                                                                                                                                              $ regex='^\s*(\S+)(?:\s+([\d\.e+-]+)){4,}'
                                                                                                                                                                                              +
                                                                                                                                                                                              +$ du -csh /some/*/location/ | tail -1
                                                                                                                                                                                              +17G     total
                                                                                                                                                                                              +
                                                                                                                                                                                              +$ time elixir -r search.exs -- "$regex" /some/*/location/*
                                                                                                                                                                                              +165984 results; nothing more in last 1s
                                                                                                                                                                                              +elixir -r search.exs --    220.98s user 6.38s system 1147% cpu 19.816 total
                                                                                                                                                                                              +
                                                                                                                                                                                              +$ time grep -Pq "$regex" /some/*/location/*
                                                                                                                                                                                              +grep -Pq    31.92s user 6.51s system 34% cpu 1:50.30 total
                                                                                                                                                                                              +

                                                                                                                                                                                              This meant that the Elixir prototype was 5.7 times faster than grep(1), but why?

                                                                                                                                                                                              +

                                                                                                                                                                                              The answer is parallelism: grep(1) is a single OS process that handles a +single file at a time. Whereas in the Elixir prototype, each file is +handled by its own dedicated Erlangprocess”, which is an actor +(see also Command Pattern) that is significantly lighter than any OS +process or thread. This difference is readily seen in the CPU utilization +statistics reported by the time(1) command:

                                                                                                                                                                                              + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                              User timeSystem timeCPU utilizationElapsed time
                                                                                                                                                                                              Elixir220.98s user6.38s system1147% cpu19.816 total
                                                                                                                                                                                              grep(1)31.92s user6.51s system34% cpu1:50.30 total
                                                                                                                                                                                              +

                                                                                                                                                                                              Here we see that the Elixir prototype utilized 11.47 CPU cores worth of +computational resources, whereas grep(1) utilized only 34% of only one +CPU core. Since the machine that ran this search had 24 CPU cores, +several of which were already under heavy use by ~800 other users on it, +this was a remarkable result.

                                                                                                                                                                                              +

                                                                                                                                                                                              In short, parallelism won. And so did Elixir and the Erlang VM, for this +was my first time, in 18 years of programming, seeing my code exhaust +a machine’s entire CPU capacity with no extra effort on my part! The +revolution has arrived.

                                                                                                                                                                                              +

                                                                                                                                                                                              \ No newline at end of file diff --git a/engram-keyboard-layout.html b/engram-keyboard-layout.html new file mode 100644 index 0000000..8943687 --- /dev/null +++ b/engram-keyboard-layout.html @@ -0,0 +1,445 @@ +Switching to Arno's Engram 2.0 keyboard layout - The Terminal Programmer

                                                                                                                                                                                              Switching to Arno's Engram 2.0 keyboard layout

                                                                                                                                                                                              Suraj N. Kurapati


                                                                                                                                                                                              +

                                                                                                                                                                                              NOTE: See also my programmer-friendly variation of this layout.
                                                                                                                                                                                              +DEMO: Watch this video of me typing in this layout at 100+ WPM.

                                                                                                                                                                                              +

                                                                                                                                                                                              Click to watch video

                                                                                                                                                                                              +
                                                                                                                                                                                              +

                                                                                                                                                                                              It happened again: for the third time in my life, I switched to a better +keyboard layout, embarking on a months-long journey of reprogramming my brain, +rewiring decades worth of accumulated muscle memory through deliberate practice.

                                                                                                                                                                                              +

                                                                                                                                                                                              100+ words per minute on Dactyl Manuform keyboard with Arno's Engram 2.0 layout +

                                                                                                                                                                                              +

                                                                                                                                                                                              I originally typed in QWERTY for 6 years, then Dvorak for 16 years, and finally +BEAKL-15 for the last 6 months. This time, a novel layout of rigorous scientific +design caught my attention and I eagerly watched its evolution into version 2.0.

                                                                                                                                                                                              +

                                                                                                                                                                                              1. Layout
                                                                                                                                                                                                1. Review
                                                                                                                                                                                                  1. One week later
                                                                                                                                                                                                    1. Two weeks later
                                                                                                                                                                                                      1. One month later
                                                                                                                                                                                                        1. Two years later
                                                                                                                                                                                                        2. Learning
                                                                                                                                                                                                          1. KeyBr
                                                                                                                                                                                                          2. Adaptation
                                                                                                                                                                                                            1. Pinky finger usage
                                                                                                                                                                                                              1. Cardinal directions (HJKL)
                                                                                                                                                                                                              2. Variations
                                                                                                                                                                                                                1. Engrammer
                                                                                                                                                                                                                  1. Z and Q
                                                                                                                                                                                                                    1. Variant Zh
                                                                                                                                                                                                                      1. Variant ZQl
                                                                                                                                                                                                                        1. Variant ZQb
                                                                                                                                                                                                                        2. B and V
                                                                                                                                                                                                                          1. Variant BVh ZQu
                                                                                                                                                                                                                            1. Variant BVh ZQl
                                                                                                                                                                                                                              1. Variant BVh ZQb
                                                                                                                                                                                                                                1. Variant BVb ZQu
                                                                                                                                                                                                                                  1. Variant BVb Zh
                                                                                                                                                                                                                                    1. Variant BVb ZQl
                                                                                                                                                                                                                                  2. Comparison
                                                                                                                                                                                                                                    1. Dygma
                                                                                                                                                                                                                                      1. QWERTY
                                                                                                                                                                                                                                        1. BEAKL
                                                                                                                                                                                                                                          1. Dvorak
                                                                                                                                                                                                                                            1. Colemak
                                                                                                                                                                                                                                              1. Halmak

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Layout

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Arno’s Engram layout v2.0 is an optimized key layout for touch typing in +English based on ergonomic considerations, with a protocol and software +for creating new, optimized key layouts in other languages.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              [{ 1| 2= 3~ 4+  5<  6>  7^ 8& 9% 0* ]} /\
                                                                                                                                                                                                                                              +   bB yY oO uU  '(  ")  lL dD wW vV zZ #$ @`
                                                                                                                                                                                                                                              +   cC iI eE aA  ,;  .:  hH tT sS nN qQ
                                                                                                                                                                                                                                              +   gG xX jJ kK  -_  ?!  rR mM fF pP
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Rendering of this layout on an ergonomic keyboard. + + +Rendering of this layout on an ortholinear keyboard. + + +Rendering of this layout on a standard 60% keyboard. +

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              English language heatmap on a conventional keyboard. +

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Review

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram’s novel placement of punctuation in the middle columns of the keyboard +eliminates lateral movement of the index fingers while simultaneously providing +quick access to frequently used punctuation marks (i.e. comma and period feel +heavenly). I haven’t seen any other layouts do this before; especially spilling +over the remaining letters to the right hand pinky cluster — it’s pure genius!

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              The layout is very comfortable and it also lends itself well to programming. +Notably, I’m a die-hard Vim user and it passes my test for ergonomic Vim usage:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • J and K are adjacent (identical to Dvorak, actually) — ideal 💯
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • H and L are adjacent (albeit on the same finger) — good 👍
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • W is on right-hand strong ring finger — good 👍
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • B is on left-hand weak pinky finger — ouch 🤕 (but the left-hand strong +ring finger can easily hop over to take the load off the pinky — okay 👍)
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Update: I wrote that remark about the B key back when I was using the + flat/2D ErgoDox EZ keyboard, and it’s no longer a concern for me beyond the + learning stage – especially on my current curved/3D keyboard. 🥣

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • Punctuation is in the middle so either hand can type it — ideal 💯
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • Shifted symbols on number keys are intuitive or mnemonic — great 👍
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In addition, Engram also arranges Vim’s operator+motion sequences as rolls (mostly +inward rolls) and alternations, plus some keys have Vim-esque affinity:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • ea (inroll) go to end of word and append
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • bi (inroll) go to start of word and insert
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • ciw (inroll) change inside word
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • caw (inroll) change around word
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • yiw (inroll) yank inside word
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • yaw (inroll) yank around word
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • dw (roll) delete to end of word
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • diw (alt+roll) delete inside word
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • daw (alt+roll) delete around word
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • t (jump upto char) comes before f (jump onto char) in left-to-right order
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • n and p are clustered for next/previous menu navigation and completion
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • y (yank) and p (paste) are on opposite hands to since they’re so different
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • b (beginning of word) and w (end of word) are split apart and left-to-right
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • and so on…
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I want to thank Arno Klein for +sharing his genius with the world. 🙇 This layout is truly a masterpiece; +a game changer! 🤩 Moreover, its systematic and methodical invention (and +generous explanation thereof) allows interested people to understand how +this layout has come to be (by simply rendering the Python notebook on +their own system) and to perform further research and improvement.

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              One week later

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              It has been a week since I switched to Engram and here is my experience so far:

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              +My progress in Typing Speed, Number of Errors, and Number of Keys. +

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Curiously, the BEAKL-15 layout that I switched over from has the same +left-hand vowel cluster as Engram, and this commonality significantly reduced +my transition time. In contrast, it took me a month to become comfortable with +that vowel cluster when I previously switched from Dvorak to BEAKL-15 six +months ago.

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Vowel cluster in BEAKL-15 and Arno’s Engram layouts:

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              :: :: :: :: ::  ::  ::  :: :: :: :: :: ::
                                                                                                                                                                                                                                              +   :: :: oO uU  ::  ::  :: :: :: :: :: :: ::
                                                                                                                                                                                                                                              +   :: iI eE aA  ::  ::  :: :: :: :: ::
                                                                                                                                                                                                                                              +   :: :: :: ::  ::  ::  :: :: :: ::
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Vowel cluster in Dvorak layout:

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              :: :: :: :: ::  ::  ::  :: :: :: :: :: ::
                                                                                                                                                                                                                                              +   :: :: :: ::  ::  ::  :: :: :: :: :: :: ::
                                                                                                                                                                                                                                              +   aA oO eE uU  iI  ::  :: :: :: :: ::
                                                                                                                                                                                                                                              +   :: :: :: ::  ::  ::  :: :: :: ::
                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Two weeks later

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              After another week of real-world use (but this time without as much +dedicated typing practice), I’m happy to say that I’m now comfortably +typing at ~60 WPM as the new Engram muscle memory is finally taking +precedence in my brain (thank goodness for neuroplasticity!). 🤓

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I made a few tweaks to the ortholinear version of Engram on my Ergodox +EZ keymap +for programming convenience and general comfort:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • I relocated the @ # / keys to the unused left-hand pinky keys (the +slash is especially handy for URLs, file paths, and Vim searching)
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • I put redundant square & angle brackets on either single-hand +(otherwise the ortholinear split disconnects them, very far apart)
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • I use a dedicated symbol layer +that further minimizes reaching by clustering frequent sigils & +delimiters along the home row/block.
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In addition, I would like to emphasize that Engram feels very +comfortable to type in. With BEAKL-15, I often felt like I’m “climbing +a wall” when typing (for example, the word “spring” has me reaching up +and down a lot). Whereas with Engram, I feel like I’m “spreading my +wings” and gracefully taking flight. It’s a significant qualitative +improvement. 😌

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              One month later

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              It’s been a month since I’ve switched to Engram 2.0 and I’m happy to report +that I’m comfortably typing at 70+ WPM. 🤩

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In particular, I’ve noticed that my inter-key typing speed is the fastest I’ve +ever observed in my 23 years of typing! 🏃💨 Portions of words (especially +those in rolls) form rapidly on my screen as I type, though entire words take +relatively longer due to momentary pauses as my muscle memory context switches +between different finger/hand placements. This is no doubt the result of those +interkey speed and finger strength matrices applied from Arno Klein’s extensive +research. 👌

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Overall, I feel that I’m now at 95% confidence while typing: subconsciously +finding the right keys to press and positioning my fingers in anticipation of +the next characters coming down the pipeline. Productivity wise, I feel 50% +more efficient.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Surprisingly, this newfound speed & efficiency was achieved while maintaining +typing comfort, not at its expense. For example, the word “highlight” is +delightful to type in Engram whereas I had to mentally prepare myself and +concentrate to type it quickly in BEAKL-15.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              However, I do notice minor slowdowns on upward-traveling same-finger bigrams +such as “je” in the word “object”, but this is more influenced by the style of +keyboard being used than Engram itself. For instance, I notice this more on my +Ergodox, which has larger & distantly placed keys than those on my laptop. In +general, Engram scores well with low 1.24% Same Finger Bigrams (SFBs). 👌

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In conclusion, Engram feels very comfortable due to its generous allotment of +inward rolls (that “you” and “th” feel amazing), heavier emphasis on home row +and bottom rows, balanced distribution between vertical climbs & horizontal +spreads. 💯

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Two years later

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I’ve reached a comfortable speed of 100+ WPM with Engram 2.0 after properly +configuring my programmable keyboard with custom firmware that disambiguates +home row mods and lets me type more naturally, without artificial slowdowns. 🥲

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              100+ words per minute on Dactyl Manuform keyboard with Arno's Engram 2.0 layout +

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Looking back at my progress, I see that I had already reached a speed of 70+ WPM +after a month, +so it was my keyboard’s firmware that held me back until now! 🚀

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Learning

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Learning a new layout is primarily a matter of time and effort: it just takes +practice, hang in there! :sunglasses::thumbsup: And continue training with +layout agnostic tutors like KeyBr.com and N-gram Type.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              It may be helpful to write down the layout on a piece of paper: each row has only +4 letters anyway (except for the outliers Z and Q), so it chunks very well into +human memory’s working capacity of about 5-7 items at a time (according to +something I read in general science news).

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Writing (and presenting or teaching – per Feynman) brings together different +memory subsystems and solidifies knowledge in a holistic way. If you’re a visual +thinker like I am, this may help you immensely. ️🌤️ Draw the +layout, make interconnections between related letters, and you’ll be set.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              For example, @jlangstrom on Discord came up with a novel mnemonic system +🧠✨ where he would associate opposing pairs of letters per finger +with words in English as well as his native language, Swedish:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              “I remember the two characters by thinking that they are short hands. CN (china) KR (Korea) IS (Ice in swedish) ET (E.T phone home) and so on.”

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              KeyBr

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I’ve used the KeyBr typing tutor to learn two different keyboard layouts in recent years. 👌🤓 It introduces a few new keys at a time (in English letter frequency order, so it’s layout agnostic 😎) until you gain proficiency, before advancing you further. Moreover, it gives you random English-like word fragments as you level up, so there’s a good variety for training compared to the typical fjfj style of rote exercises. I highly recommend it for learning a new layout.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              You can hide the on-screen keyboard in KeyBr by pressing the Zoom button (next to the Settings button, with the gear icon). Then open another window below or beside it containing a reference image for the layout you’re learning. This way, you’re effectively visually replacing keybr’s on-screen keyboard with your own, and thus there’s no confusion. 🪄

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Adaptation

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Learning a new layout takes time (several days at least, because your brain internalizes the new concepts while you sleep — that’s what I’ve observed1 anyway) and this may be especially true coming from QWERTY and Colemak because they distribute vowels across both hands whereas Engram, Dvorak, and BEAKL cluster all vowels on the left hand, so it may take a little more effort to get used to it initially. 🧗 But the advantage of such clustering is that it improves hand balance & alternation, and is generally useful for international languages2.

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Pinky finger usage

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I’ve heard concerns about Engram’s placement of B on the left pinky finger – since most people are coming from QWERTY and their left pinky is relatively underutilized (and thus weaker) due to the fact that Q is one of the least frequent letters in English. In fact, I too observed this firsthand when I transitioned from Dvorak (which places the relatively infrequent apostrophe / single quote there) but my left pinky got stronger with practice and it hasn’t been an issue for me past the learning stage. Nevertheless, if this still remains a concern for you, consider these alternate placements for Q/Z and B/V.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In addition, I’ve found that the left pinky column in Engram (BCG) isn’t a problem in practice on contoured columnar keyboards (such as the Glove80, Dactyl, etc.) compared to traditional row-staggered keyboards (which the Alt-Layouts discord appears to be more concerned with optimizing). See this Reddit comment for further elaboration.

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Cardinal directions (HJKL)

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I presume you are accustomed to Vim’s traditional HJKL order? 🙂 I map the 4 right-hand fingers on the Cursor layer’s home row as Left, Up, Down, Right to according to the inward-rising curvature of the Glove80 keyboard. This is a longstanding preference that I formed 17 years ago, in my early days of using the Kinesis Advantage with the Dvorak layout, whose lack of HJKL provided the freedom to reimagine the arrangement of arrow keys on the home row.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In particular, I find it more natural to follow the inward-rising curve of the keyboard’s curved 3D keywell, which elevates the thumb above the pinky finger and, similarly, the middle finger (up arrow) above the ring finger (down arrow). As a bonus, this arrangement avoids double-duty on the index finger (for H & J) such that each home row finger is responsible for exactly one cardinal direction. Curiously, there is one thing in common (identical, actually) between HJKL and my arrow arrangement: K/up is on the middle finger.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In addition, my arrangement is consistent with the left-to-right (LTR) directionality of the Home, Page Up/Down, End keys on the lower row just beneath. Similarly, the clustering of Up with Left and Down with Right also reflects LTR because that’s how, say, a document shrinks & grows respectively in a text editor or word processor. See also this Reddit comment for additional context.

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variations

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Here’s the baseline layout with which to compare the variations discussed below:

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              baseline for variants +

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Depending on your ergonomic concerns, you might find these variations more +comfortable, or at least preferable, on ergonomic keyboards such as the +Glove80.

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Engrammer

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engrammer variant +

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              This variation helps maintain cross-proficiency with conventional keyboards:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • Shifted pairs are standard (e.g. quotes don’t shift to parentheses).
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • Semicolon is placed relative to comma and period just like standard.
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • Equals and square brackets are placed near their standard locations.
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In addition, application shortcuts that assume standard shifted pairs (such as +Control-Equals for the “zoom in” operation in Web browsers) now work correctly.

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Z and Q

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              The Z and Q keys overload the right pinky finger asymmetrically in the Engram +layout due to the physical constraints of traditional row-staggered keyboards. +This is an acceptable compromise because Z and Q are the least frequent letters +in English: although they overload the right pinky finger, it seldom types them.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I was fond of variant ZQb, discovered by @x10an14, because it eliminates lateral movement of the right pinky finger, making the +layout truly columnar. 💯 I tried switching to this personally but found that I +use the CapsWord key more often than Z or Q, so the standard Engram layout was actually better for me. 😯

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant Zh

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-Zh variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • Zh = Z on home row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant ZQl

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-ZQl variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • ZQl = Z and Q on lower row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant ZQb

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Credit: This variant was discovered by @x10an14.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-ZQb variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • ZQb = Z and Q on bottom row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              B and V

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Similarly, some people dislike reaching up for the B and V keys with their pinky +fingers or even, in some cases, reaching down for the G and P keys too!

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant BVh ZQu

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-BVh-ZQu variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • BVh = B and V on home row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • ZQu = Z and Q on upper row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant BVh ZQl

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-BVh-ZQl variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • BVh = B and V on home row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • ZQl = Z and Q on lower row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant BVh ZQb

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-BVh-ZQb variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • BVh = B and V on home row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • ZQb = Z and Q on bottom row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant BVb ZQu

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Credit: This variant was discovered by @ericjuta.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-BVb-ZQu variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • ZQu = Z and Q on upper row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • BVb = B and V on bottom row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant BVb Zh

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-BVb-Zh variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • Zh = Z on home row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • BVb = B and V on bottom row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Variant BVb ZQl

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram-BVb-ZQl variant +

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • ZQl = Z and Q on lower row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • BVb = B and V on bottom row
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Comparison

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Dygma

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Engram has been featured in Dygma’s “What’s the best keyboard layout?” article and its accompanying YouTube video at the tail end of February 2023, as follows:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Developed in 2021, Engram is a project completely created from scratch, focusing mainly on the best way to type diagrams, trigrams, or… Ngrams. The punctuation in the middle creates a clear gap between the hands, which makes it one of the best layouts for split columnar keyboards.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              heatmap +

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              @Omnishambles asked on the Discord server for MoErgo Glove80 on April 20, 2023:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              The Engram heatmap really makes the stacking of E and O on the same finger stand out. I know it’s one of the least-used vowel bigrams, but it’s still a vowel bigram. Does that combination ever feel awkward to you?

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Not at all. 👍 I feel quite comfortable with the EO bigram in the Engram layout because it’s on the column assigned to the middle finger (the longest one), where ascending from E to O feels more like uncurling or lengthening (as opposed to reaching) the middle finger from its home row position. 🤔 Take a look at the rationale (and alternatives) that Engram considered for vowel clustering & placement.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              As for the layout heatmaps in that Dygma article, they seem to have been created inconsistently: the Dvorak heatmap shows activity on the left shift key whereas the others don’t. Similarly, the Colemak, Dvorak, and Halmak heatmaps don’t highlight the O key (certainly not in red) as much as the others. Thus, it’s unclear what input text they typed on each layout when generating those heatmaps: each one seems to have had a different input.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              A better source for heatmap comparison might be Ian Douglas’ database, which shows heatmaps for English, programming, bigrams, and so on. For example, here is the English heatmap for the Engram layout:

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              QWERTY

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Jonathan Wheeler asked in the comments section of this article on July 8, 2023:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              After reprogramming your brain to use different key layouts several times, when using someone else’s device, or a smartphone without a keyboard, etc, do you have any difficulty spontaneously switching back to the ol’ QWERTY when needed?

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Not at all — in practice, I’ve found that it’s not a zero-sum game:

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              To my surprise, I still retain my QWERTY muscle memory, even nearly 2 decades after switching away from it! For instance, it’s especially strong when swiping (aka “glide typing”) on smartphones: I somehow Just Know the placement of all the letters perfectly, without conscious thought. Perhaps the physical interface of a smartphone’s virtual keyboard (behind a smooth glass display) is different enough from my ergonomic keyboards (split, columnar, with contoured keywells) that my brain doesn’t get confused.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              However, actual touch-typing in QWERTY on conventional row-staggered keyboards is a bit rusty, but still workable. For instance, I was at my local public library recently where I had to fill out some forms on a computer kiosk: I was able to approximately touch-type (not as bad as hunt & peck, but not as good as blind touch-typing) on QWERTY even though I left it behind so long ago.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In contrast, I have no trouble typing in the Engram layout (and previously in BEAKL-15 and Dvorak) on conventional row-staggered keyboards (such as my laptop’s built-in keyboard) because the knowledge of where keys are located (along with the physical movements necessary to reach and press them) is ingrained in my muscle memory: it’s like a “device driver”. Whereas the actual key-to-letter mapping seems to be stored independently (stacked atop muscle memory, as a higher layer) because it can be overridden and reused on different physical keyboards: it’s like an “input method”.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In this manner, I’ve found that when you learn to type in a new layout or to use a different style of keyboard, it’s more like adding a new capability than replacing existing skills. Such that the very act of typing is effectively a transformation of your brain’s high-level thoughts and words into low-level physical keypresses by the appropriate combination of “input method” and “device driver” for the particular keyboard and layout you’re currently using. With sufficient practice, it all Just Works without conscious effort and on a variety of different physical keyboards (and layouts too, if you so wish). 🙌

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Neuroplasticity for the win! (You’ll be fine 👍 — I’d highly recommend it.)

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              BEAKL

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Graeme Geldenhuys, who first introduced me to BEAKL-15 and the legendary Miryoku system of layers and home row mods, asked me the following on May 16, 2021:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I’m curious what made you move away from BEAKL-15? Was there anything in particular that you did not like or struggle with.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              With BEAKL-15, I ultimately felt that I didn’t experience the comfort that was advertised: I often felt like “climbing up a wall” when typing (for example, the word “spring” has me reaching up and down vertically). Also, I ended up forking my own variation after 3 months because the punctuation assignments weren’t as convenient as I liked for programming. Eventually, I found the obscure BEAKL-19bis layout which scored well on a comparison page and I was interested in learning more about its origins (how did the authors invent it? what principles guided them?) but I was too late: like an archaeologist pondering ancient civilizations, so too, I was left with more questions than I could investigate and was left demoralized. Even the BEAKL authors (Den and Ian) disappeared, along with the Shenafu forums where they discussed their creations, just a few months before I even heard about BEAKL. 😞

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Thankfully, I found that Ian Douglas (now known as @iandoug on GitHub) was still active elsewhere and actually ran the keyboard-design.com website which I encountered while investigating BEAKL-19bis. On that site, he mentioned Arno Klein’s research publication and the resulting Engram layout. This caught my attention! Here was a layout, methodically & systematically derived from exhaustive comparison of permutations, guided by ergonomics principles. Not some golden result hidden behind AI algorithms like Halmak, or optimizers like AnDW for BEAKL-15, or CarpalX and MTGAP etc. Here was something that anyone could run on their own system and follow along in the Python notebook. (Plus the fact that Engram ended up on the same left-hand vowel layout as AnDW for BEAKL-15 greatly increased my confidence in the Engram methodology!)

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Also did you use the BEAKL-15 number row and symbol suggestion?

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              No, I didn’t use the BEAKL-15 number row because it’s asymmetric: 40123 76598 (I naturally expected 87659 on right hand for symmetry). Moreover, as a programmer, I type numbers even less than prose, so rearranging the already intuitive native number row didn’t seem like a worthy trade-off in my case.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              As for the BEAKL-15 symbol layer, I adapted parts of its design into my own symbol layer which is more optimized for Vim. (NOTE: My symbol layer has since evolved into this in the present day.) For example, I have ^()$ on the left hand home row of my Symbol layer which lets me quickly travel to BOL PrevSentence NextSentence EOL respectively. You can see how the BEAKL-15 symbol layer isn’t so convenient for Vim, although I do appreciate how logically it’s laid out.

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Dvorak

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I’ve typed exclusively in Dvorak for 16 years 👋 and Engram since the past 2 years. 🤓

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I find Engram more comfortable because it eliminates lateral index finger movement when typing prose: Engram places all punctuation in the central columns, so my 8 touch typing fingers go straight up and down, effectively staying in their columns all the time. Moreover, Engram adds inward rolls (like MTGAP and Colemak) and accounts for finger strength differences, in addition to Dvorak’s concept of hand alternation. This combines the best of both worlds (rolling and alternation) for a rapid, yet comfortable, typing experience.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Finally, Engram has some important similarities with Dvorak: E and T/H and J/K placement is the same in both layouts. As a die-hard Vim user (since the last 14 years), I find that Engram has an even better L placement (directly above H; both on the strong index finger) than Dvorak while retaining its convenient J/K placement. See my review above for details.

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Colemak

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              @formlessdao asked in Arno’s Engram discussion board on GitHub on June 8, 2021:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              What are the improvements of Engram over Colemak Mod-DH and Halmak?

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              I would say the main advantage is that Engram was designed from a clean slate with support for columnar split/ortholinear keyboards in mind. 💡 Moreover, it doesn’t limit itself to the historical legacy and physical constraints of typewriter style row-staggered keyboards.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              For example, Engram takes full advantage of the former style of columnar keyboards (where each finger can travel straight up and down along its own dedicated column) by eliminating lateral movement of the index fingers into the central columns for typing letters (A-Z).

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In contrast, Colemak assumes the latter style of row-staggered keyboards because it retains the ZXCV sequence from QWERTY legacy for application & clipboard shortcuts (which become far less important when you have a fully programmable keyboard that lets you place such shortcuts on dedicated keys, layers, combos, macros, etc. anywhere you like) and also because Colemak’s variations (AngleMod, DH-mod, etc.) balance & redistribute finger workloads in a way that might not provide much benefit on columnar keyboards. For instance, consider the AngleMod: how would you use that “angle” on keyboards with curved 3D keywells (e.g. Glove80, Dactyl, Kinesis, Maltron) anyway? 😵‍💫

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              As an overall comparison of Colemak and Engram statistics, what do you think of page 113 in the Alt Keyboard Layouts community’s document on all things AKL? On that page, I see that Engram brings a modest reduction in SFS%, a significant reduction in LSB% (since it doesn’t have any letters in the central columns), better balance of left/right hand workload, significantly less redirects, and more left/right hand alternation (like Dvorak) along with more than double the amount of inward rolls — all at the cost of a negligible increase in SFB% compared to Colemak and Colemak-DH (seen on the following page) alike. (And also, not mentioned on that page: the Vim friendliness it coincidentally brings with JK and HL adjacency as well as B on left hand, W on right hand, T to the left of F, comma to the left of semicolon, and ease of cw, dw, yw, etc.).

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              There are many more keyboard layouts in the ecosystem, neatly quantized by SFB% in that document’s table of contents, available to be explored. But my feeling is that, if Colemak is considered to be a good enough campsite for travelers (welcomed by familiarity of conventional row staggered keyboards: ZXCV preservation, angle mods, and alt-fingering options to choose from) to settle down at, couldn’t Engram also be considered in the same light for split columnar keyboards (forgo ZXCV in favor of semantic undo/redo/cut/copy/paste keys such as those in Miryoku’s navigation layer, and forgo angle mods along with alt-fingering because columnar keyboards practically enforce proper touch-typing)?

                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                              Halmak

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Similarly, Halmak’s AI was trained on a MacBook laptop’s row-staggered keyboard, so it literally assumes that exact physical key placement as well as its trainer’s natural home row finger placement (see “fingers are not perfect” at timestamp 5:11). Thus, it might not provide as much benefit for columnar split/ortho keyboards or for those who have a different natural home row placement than the AI’s trainer. 🤔

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                              1. +

                                                                                                                                                                                                                                                I’ve found that time away from practice (especially sleep) actually gives the brain a chance to reinforce and optimize all those new neurological pathways you’re building in the form of muscle memory. You might be a little rusty for the first few minutes but soon it’ll all come rushing back. 🌊 That’s what I observed recently after a week-long break away from computers. 

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              2. + +
                                                                                                                                                                                                                                              3. +

                                                                                                                                                                                                                                                Specifically, I would consider layouts such as Engram and Dvorak that cluster all the vowels on one hand because words in Indo-European languages are composed of consonant+vowel formations, so you’ll get a more balanced workload distribution across both hands this way. Moreover, these improvements would benefit all of the languages you type in — whereas right now, they’re all encumbered by QWERTY legacy. :disappointed_relieved: 

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              4. + +
                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Updates


                                                                                                                                                                                                                                              Readably written, Everforest colored.

                                                                                                                                                                                                                                              Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/engrammer-keyboard-layout.html b/engrammer-keyboard-layout.html new file mode 100644 index 0000000..d68f0c9 --- /dev/null +++ b/engrammer-keyboard-layout.html @@ -0,0 +1,30 @@ +Engrammer - Arno's Engram layout for programmers - The Terminal Programmer

                                                                                                                                                                                                                                              Engrammer - Arno's Engram layout for programmers

                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              DEMO: Watch this video of me typing in this layout at 100+ WPM.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Click to watch video

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              After 1.25 years of using Engram exclusively, I recently needed to type on a standard laptop keyboard featuring the QWERTY layout. I found myself struggling to locate symbols and punctuation marks (especially those on shifted keys) as I reluctantly resorted to hunt-and-peck typing. 😩 However, I was pleasantly surprised to find that it was significantly easier to type certain punctuation marks used in programming (such as backtick, backslash, semicolon, and equals) because they were unshifted: directly available, without needing to press Shift!

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Having tasted the renewed ease of access to those aforementioned symbols (which happen to be used heavily in programming editors, such as Vim, and also more generally in application shortcuts such as Control-Equals for the “zoom in” operation), I could no longer return to Engram verbatim. 🤩 Instead, I was motivated to rectify the situation by harnessing the best of both worlds. Behold, the Engrammer layout: a variation of Arno’s Engram for programmers! :)

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              `~ 1! 2@ 3# 4$  5%  6^  7& 8* 9( 0) [{ ]}
                                                                                                                                                                                                                                              +   bB yY oO uU  '"  ;:  lL dD wW vV zZ =+ \|
                                                                                                                                                                                                                                              +   cC iI eE aA  ,<  .>  hH tT sS nN qQ
                                                                                                                                                                                                                                              +   gG xX jJ kK  -_  /?  rR mM fF pP
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Legend: Gold is Arno’s Engram; Blue is Engram-like; Pink is new. +Rendering of this layout on a standard 60% keyboard. +Rendering of this layout on an ortholinear keyboard.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              This variation helps maintain cross-proficiency with standard keyboards because:

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • Shifted pairs are standard (e.g. quotes don’t shift to parentheses).
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • Semicolon is placed relative to comma and period just like standard.
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • Equals and square brackets are placed near their standard locations.
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              In addition, application shortcuts that assume standard shifted pairs (such as +Control-Equals for the “zoom in” operation in Web browsers) now work correctly.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/ergohaven-remnant-keyboard.html b/ergohaven-remnant-keyboard.html new file mode 100644 index 0000000..c856d84 --- /dev/null +++ b/ergohaven-remnant-keyboard.html @@ -0,0 +1,441 @@ +Ergohaven Remnant programmable ergonomic keyboard - The Terminal Programmer

                                                                                                                                                                                                                                              Ergohaven Remnant programmable ergonomic keyboard

                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              DEPRECATED: This has been superseded by the MoErgo Glove80 keyboard.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              NOTE: Check out the interactive layer map for this keyboard below!

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Photograph of my Dactyl Manuform 5x6 keyboard. +

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              This is my Ergohaven Remnant keyboard: specifically, it’s a 5-row and 6-column +variant of the Dactyl Manuform that I’ve fitted with symbolic Ideogram keycaps, +linear yellow key-switches, and enhanced firmware with legendary Miryoku design.

                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Video: Indicators for modifiers and layers using per-key LEDs.

                                                                                                                                                                                                                                              + + +
                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Prior to this, I used a Dactyl Manuform 5x6 +keyboard for a year, an ErgoDox EZ keyboard for 6 years, and a Kinesis +Advantage keyboard for 11 years before that.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              1. Review
                                                                                                                                                                                                                                                1. Layers
                                                                                                                                                                                                                                                  1. Cursor layer
                                                                                                                                                                                                                                                    1. Arrow keys
                                                                                                                                                                                                                                                      1. Select & edit
                                                                                                                                                                                                                                                      2. Number layer
                                                                                                                                                                                                                                                        1. Date & time
                                                                                                                                                                                                                                                          1. Arithmetic
                                                                                                                                                                                                                                                            1. Prefix signs
                                                                                                                                                                                                                                                              1. Inequalities
                                                                                                                                                                                                                                                              2. Function layer
                                                                                                                                                                                                                                                                1. Symbol layer
                                                                                                                                                                                                                                                                  1. Base layer affinity
                                                                                                                                                                                                                                                                    1. Vim editor shortcuts
                                                                                                                                                                                                                                                                      1. Adjacent key bigrams
                                                                                                                                                                                                                                                                        1. Outer corner bigrams
                                                                                                                                                                                                                                                                          1. Inward rolling bigrams
                                                                                                                                                                                                                                                                            1. Outward rolling bigrams
                                                                                                                                                                                                                                                                            2. Mouse layer
                                                                                                                                                                                                                                                                              1. System layer
                                                                                                                                                                                                                                                                              2. Firmware
                                                                                                                                                                                                                                                                                1. Extra QMK patches
                                                                                                                                                                                                                                                                                  1. QMK configurator app
                                                                                                                                                                                                                                                                                    1. Building the firmware

                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Review

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Here is my review of this keyboard, as published on Ergohaven’s reviews channel.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Photograph of my Ergohaven keyboards. +

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    I’m a happy customer of two Ergohaven keyboards: the Dactyl Manuform 5x6 (top in photo) from 2021 and the Remnant (bottom in photo) from 2022.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    As a professional software engineer, I heartily recommend the Remnant to my colleagues and friends as my “end game” keyboard after having used an Ergohaven Dactyl Manuform 5x6 (split and contoured) for 1 year, a ZSA ErgoDox EZ (split but not contoured) for 6 years, and a Kinesis Advantage (contoured but not split) for 11 years before that.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    In terms of aesthetics, the Remnant’s fine lines and starlight material stand out elegantly (like a tuxedo) in contrast to the Dactyl Manuform 5x6’s thick lines and muted colors (like a trenchcoat). This shows just how much Ergohaven’s 3D printing skill and product quality has improved over the past year.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    In terms of acoustics, the Remnant resonates with a pleasing “thock” on most keystrokes (especially on the thumb cluster keys) and wholly eliminates the hollow sound of the Dactyl Manuform 5x6. To my ears, the Remnant produces a premium sound like those fancy modded keyboards you see on YouTube reviews.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    In terms of design, the Remnant greatly improves upon the Dactyl Manuform 5x6 by reducing the overall height of the keyboard (low profile), removing two vestigial keys from the bottom row of the thumb cluster (they were difficult to reach and I only pressed central one with the metacarpal joint of my thumb anyway), and realigning the thumb cluster to make all 3 keys easier to reach.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    In terms of firmware, the Remnant’s VIAL support makes it very easy for newcomers to remap their keyboard using a desktop app or Web browser. For advanced users, the Remnant also supports QMK natively, so you can still “qmk flash” your own custom firmware onto it. Notably, I’m able to use my custom QMK implementation of home row mods based on the bilateral combinations concept from the legendary Miryoku layout (which works beautifully with the Remnant’s 3-key thumb clusters, by the way) on both the Remnant and the Dactyl Manuform 5x6.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    In terms of hardware, the Remnant features per-key RGB lighting, a powerful ARM processor with 62x more onboard memory (for tapdance, combos, macros, lighting effects and custom firmware), and most impressively a curved PCB that houses hot-swappable switches! This makes the Remnant significantly more reliable than my Dactyl Manuform 5x6, which was an early hand-wired version that unfortunately experienced some electrical disconnects over time (but thankfully they were simple enough that I could debug and re-solder them by myself).

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Overall, the Remnant is an excellent upgrade from the Dactyl Manuform 5x6, and both Ergohaven keyboards are lightyears ahead of the status quo. I’m very happy with my purchases and to see the Ergohaven team improve so much! Thank you and best regards.

                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Layers

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    The keyboard boots up into the following default “base” layer when powered on. +When held, the purple keys in the thumb +clusters activate the subsequent layers according to the legendary Miryoku’s +6-layer design with 3-key thumb activation.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Interactive: Hover your mouse over the purple keys to see each layer! +

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    + + +

                                                                                                                                                                                                                                                                                    The keys are arranged in my variation of Arno Klein’s Engram +2.0 layout and they’re imbued with the legendary Miryoku home +row mods tamed with enhancements.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Going beyond Miryoku, I have added custom “sticky layer toggle” functionality to the +Shift keys of each Miryoku layer for times when I need use a layer for longer +than a brief moment. For example, pressing Shift after activating a Miryoku layer +with my thumb keeps that layer activated henceforth (thus making it “sticky”), +allowing me to release my thumb off the Miryoku layer key. Similarly, pressing +Shift again deactivates the Miryoku layer (thus making it “unsticky”) and sends +me back home to the base layer.

                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Cursor layer

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Diagram of the cursor layer. +

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Arrow keys

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    The up/down arrow keys on the right-hand home row diverge from Vim’s HJKL order +because it feels more natural to follow the inward-rising curve of the keyboard’s +contoured keywell, which elevates the thumb above the pinky finger and, similarly, +the middle finger (up arrow) above the ring finger (down arrow).

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    This is a longstanding preference that I formed 17 years ago, in my early days of +using the Kinesis Advantage with the Dvorak layout, whose lack of HJKL provided +the freedom to reimagine the arrangement of arrow keys on the home row.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Select & edit

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Editing (index finger) and selection (thumb cluster) keys line the inner wall. +This opposition allows for pinching, where selections can be followed by edits. +For example, to copy everything, I would first tap the “Select all” key with my +thumb and then pinch slightly inward to tap the “Copy” key with my index finger.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    The copy and paste keys are stacked vertically, in that order, to allow the index +finger to rake down upon them in a natural curling motion toward the palm. This +order is also logical, since pasting requires something to be copied first.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    The versatile “Select word/line” key at the thumb cluster’s home position is powered +by Pascal Getreuer’s word selection QMK macro, which automates common +selection tasks that require holding down Control and Shift with the arrow keys:

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    +Video demonstration of Pascal Getreuer's word selection QMK macro
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Tapping it selects the word under the cursor; shift-tapping it selects the line. +Further taps extend the selection by another word (unshifted) or line (shifted).

                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Number layer

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Diagram of the number layer. +

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    A 3x3 numeric keypad (using the standard 10-key layout) occupies the home block. +The period and comma keys are positioned near the zero key on the thumb cluster. +Square brackets from the base layer are replaced with parentheses for grouping.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Date & time

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    The slash and minus keys are positioned for MM/DD and YYYY-MM-DD date entry. +Similarly, the colon key is positioned above them for HH:MM:SS time stamp entry.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • : time stamp separator
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • - ISO-8601 date separator
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • / American date separator
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Arithmetic

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Common arithmetic operators pair along the sides of the 3x3 numeric keypad.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • % and : for percentages and proportions
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • + and - for addition and subtraction
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • * and / for multiplication and division
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Prefix signs

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Signs that commonly prefix numbers line the top of the 3x3 numeric keypad.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • ~ approximately
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • # literal number
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • $ dollar amount
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • @ at the rate of
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Inequalities

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Comparison operators are positioned along the perimeter of the home block.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • < less than
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • > greater than
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • = equal to
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ~ approximately
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Function layer

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Diagram of the function layer. +

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    The function keys are arranged in the same 10-key layout as the Number +layer’s 3x3 numeric keypad so that you can develop common muscle +memory for both layers. The remaining F10-F12 keys wrap around the home block +because they’re found in shortcuts such as BIOS save/quit, fullscreen toggle, +and devtools, respectively.

                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Symbol layer

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    This is the crown jewel of my keyboard’s configuration: an entire layer dedicated +to the entry of symbols that are essential for computer programming. +It’s the result of several hundreds of layout iterations over the last 8+ years.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Diagram of the symbol layer. +

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    👉 +Red quotes. +Green arrows. +Blue groups. +Purple flips. +Yellow Vim.

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • \ is on the thumb for escaping all other symbols without moving your hand.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • For snake_case, _ is at the same spot as English’s most frequent letter e.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • For assignment, = is on the home row because it’s frequent in programming.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • For strings, all quotation marks are located at the top of the home block.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • Bitwise |& and arithmetic -+ operators “flap down” and “fold up” together.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • Angling arrows ->, =>, <=, <-; functional programming pipes |>, <| abound!
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Base layer affinity

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • @ is at the same relative position as the Tab key on standard keyboards. +They pair well: the former denotes references and the latter expands them.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ! is on the same key as Shift on the base layer: they both invert things.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • (); sits just above the inward-rolling “you” sequence in the Engram layout.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Vim editor shortcuts

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • ^ and $ are on the home row, for jumping to the start/end of current line.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • # and * are on the home row, to search behind/ahead for word under cursor.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • = is on the home row, to automatically indent current line or selection.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • { and } are on the home block, for jumping to previous/next paragraph.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • < and > are on the home block, for decreasing/increasing indentation.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • , and ; are in proper order for previous/next repetition of f/F/t/T jumps.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ? and / are stacked vertically, to search behind/ahead for regex pattern.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • : is on the inner thumb key, for entering Vim’s command mode comfortably.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • % is on the outer thumb key, for jumping to cursor’s matching delimiter.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Adjacent key bigrams

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • #! for shebang lines in UNIX scripts.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • -> for thin arrows in C, C++, and Elixir.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • () for parentheses.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • .* for filesystem globs.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • *. for regular expressions.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Outer corner bigrams

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    These are easy to find because they’re on the outer corners of the keyboard.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • !~ for regular expression “not matching” in Perl, Ruby, and Elixir.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • /* and */ for multi-line comments in C, CSS, and JavaScript.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • \/ for escaped regular expression delimiters in Vim.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ~/ for home directory paths in UNIX.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ?! for interrobang in English prose.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Inward rolling bigrams

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • (); for zero-arity function calls in C and related languages.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ); for function call statements in C and related languages.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • () for parentheses.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • .* for regular expressions.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ~/ for home directory paths in UNIX.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • <- for assignment in R and in Elixir’s with statements.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • -> for thin arrows in C, C++, and Elixir.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • => for fat arrows in Perl, Ruby, and Elixir.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • != for “not equal to” value comparison in many languages.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • <= for “less than or equal to” comparison in many languages.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ^= for bitwise XOR assignment in C and related languages.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • |> for the pipe operator in Elixir.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • !( for negating a group in Boolean expressions.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • "$ for quoted variable substitution in Bourne shell.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • !$ for last argument of previous command in Bourne shell.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • $? for exit status of previous command in Bourne shell.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • <% for directive tags in Ruby’s ERB and Elixir’s EEx templates.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • #{ for string interpolation in Ruby and Elixir.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • #[ and ![ for metadata attributes in Rust.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • `' for legacy curly quotes.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • /* for starting comments in C, CSS, and JavaScript.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • </ for element closing tags in XML and HTML.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • <> for angle brackets.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • {} for curly braces.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Outward rolling bigrams

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • /? for query parameters in URLs.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ~> for pessimistic version constraint in SemVer.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • =~ for regular expression matching in Perl, Ruby, and Elixir.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • -= for negative accumulation in C and related languages.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • += for accumulation in C and many languages.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • %= for modulo assignment in C and related languages.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • >= for “greater than or equal to” value comparison.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • >& and &< for file descriptor redirection in Bourne shell.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • $_ for value of last argument of previous command in Bourne shell.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • %> for directive tags in Ruby’s ERB and Elixir’s EEx templates.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • ${ for variable interpolation in Bourne shell.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • %{ for maps (hash tables) in Elixir.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • */ for closing comments in C, CSS, and JavaScript.
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Mouse layer

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Diagram of the mouse layer. +

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Movement keys are located centrally in the home block, resembling WASD keys, and +mouse acceleration controls are poised for pinky finger access, so you can +independently move the mouse pointer and also change its speed at the same time.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Mousewheel down/up keys are also placed on the home block, specifically on +the same keys as J/K (down/up in Vim) on the base layer for muscle memory reuse.

                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    System layer

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Diagram of the system layer. +

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Keys for controlling RGB matrix settings line the central rows of home block, +whereas keys for applying lighting modes line the perimeter of the home block.

                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Firmware

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    My keyboard’s entire firmware, as described in this article, is +available on GitHub in the sunaku_remnant branch of my personal +fork of QMK as well as Vial.

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    ~/qmk_firmware/keyboards/ergohaven/remnant/keymaps/sunaku/
                                                                                                                                                                                                                                                                                    +├── config.h
                                                                                                                                                                                                                                                                                    +├── features -> getreuer/features
                                                                                                                                                                                                                                                                                    +├── getreuer/
                                                                                                                                                                                                                                                                                    +├── keymap_config.json
                                                                                                                                                                                                                                                                                    +├── keymap_footer.c
                                                                                                                                                                                                                                                                                    +├── keymap_header.c
                                                                                                                                                                                                                                                                                    +├── Makefile
                                                                                                                                                                                                                                                                                    +├── README.md
                                                                                                                                                                                                                                                                                    +└── rules.mk
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Extra QMK patches

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    This configuration includes additional enhancements on top of the standard QMK:

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    1. My enhanced bilateral combinations patch, used for Miryoku home row mods.
                                                                                                                                                                                                                                                                                    2. +
                                                                                                                                                                                                                                                                                    3. Pascal Getreuer’s word selection QMK macro, utilized in the cursor layer.
                                                                                                                                                                                                                                                                                    4. +
                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    QMK configurator app

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    You can upload the provided QMK Keymap JSON file named +keymap_config.json into the QMK Configurator app to view or +customize the keymap and all of its layers. When you’re finished, download the +keymap back to the same file, overwriting it.

                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                    Building the firmware

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Navigate into the directory shown in the Firmware section above and run make to:

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    1. Convert the keymap_config.json file into C source code.
                                                                                                                                                                                                                                                                                    2. +
                                                                                                                                                                                                                                                                                    3. Wrap the C source code with a custom header and footer.
                                                                                                                                                                                                                                                                                    4. +
                                                                                                                                                                                                                                                                                    5. Compile the wrapped up C source code using qmk compile.
                                                                                                                                                                                                                                                                                    6. +
                                                                                                                                                                                                                                                                                    7. Flash the compiled firmware (UF2 file) to the keyboard.
                                                                                                                                                                                                                                                                                    8. +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    All these steps are handled by the provided Makefile, shown below for reference:

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    # NOTE: Don't name the QMK Configurator JSON keymap file as "keymap.json"
                                                                                                                                                                                                                                                                                    +# because `qmk compile` directly translates it into C and compiles it too,
                                                                                                                                                                                                                                                                                    +# thereby completely bypassing this Makefile and our keymap header/footer!
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +TOPLEVEL=`git rev-parse --show-toplevel`
                                                                                                                                                                                                                                                                                    +KEYBOARD=ergohaven/remnant
                                                                                                                                                                                                                                                                                    +KEYMAP=sunaku
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +all: flash
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +flash: build
                                                                                                                                                                                                                                                                                    +	    qmk flash -kb $(KEYBOARD) -km $(KEYMAP)
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +build: keymap.c config.h rules.mk
                                                                                                                                                                                                                                                                                    +	    test ! -e keymap.json # see comment at the top of this Makefile
                                                                                                                                                                                                                                                                                    +	    qmk compile -kb $(KEYBOARD) -km $(KEYMAP) -j 0
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +keymap.c: keymap_config_converted.json keymap_header.c keymap_footer.c config.h
                                                                                                                                                                                                                                                                                    +	    qmk json2c -o $@ $<
                                                                                                                                                                                                                                                                                    +	    spot=$$( awk '/THIS FILE WAS GENERATED/ { print NR-1 }' $@ ) && \
                                                                                                                                                                                                                                                                                    +	    sed -e "$$spot r keymap_header.c" -e "$$ r keymap_footer.c" -i $@
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +keymap_config_converted.json: keymap_config.json
                                                                                                                                                                                                                                                                                    +	    sed 's|\("keyboard": *"\)[^"]*|\1$(KEYBOARD)|' $^ > $@
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +clean:
                                                                                                                                                                                                                                                                                    +	    qmk clean
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +clobber: clean
                                                                                                                                                                                                                                                                                    +	    rm -fv keymap.c keymap_config_converted.json
                                                                                                                                                                                                                                                                                    +	    rm -fv $(TOPLEVEL)/$$( echo $(KEYBOARD) | tr / _ )_$(KEYMAP).*
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    +.PHONY: clean clobber build flash
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/extjs4-mvc-rails31-asset-pipeline.html b/extjs4-mvc-rails31-asset-pipeline.html new file mode 100644 index 0000000..24b925f --- /dev/null +++ b/extjs4-mvc-rails31-asset-pipeline.html @@ -0,0 +1,52 @@ +Putting ExtJS 4 into Rails 3.1's asset pipeline - The Terminal Programmer

                                                                                                                                                                                                                                                                                    Putting ExtJS 4 into Rails 3.1's asset pipeline

                                                                                                                                                                                                                                                                                    Suraj N. Kurapati


                                                                                                                                                                                                                                                                                    ExtJS 4’s MVC architecture organizes +source files in the following structure so that its Ext.Loader class can +dynamically fetch and load the necessary Javascript files at runtime.

                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • app/ + +
                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                      • controller/
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • model/
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • store/
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • view/
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • app.js
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    In a Rails 3.1 application, you can place the above structure under the +app/assets/javascripts directory and package it as a monolithic +Javascript asset using Rails 3.1’s asset pipeline by adding the +following snippet to the app/assets/javascripts/application.js file:

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    //= require_tree ./app/model
                                                                                                                                                                                                                                                                                    +//= require_tree ./app/store
                                                                                                                                                                                                                                                                                    +//= require_tree ./app/view
                                                                                                                                                                                                                                                                                    +//= require_tree ./app/controller
                                                                                                                                                                                                                                                                                    +//= require app
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Next, add an .erb extension to the app/assets/javascripts/app.js file +and then register the packaged ExtJS 4 MVC components by adding the +following snippet to the app/assets/javascripts/app.js.erb file:

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    Ext.application({
                                                                                                                                                                                                                                                                                    +<% Dir[File.expand_path('../app/*/', __FILE__)].each do |subdir| %>
                                                                                                                                                                                                                                                                                    +  <%= File.basename(subdir) %>s: <%=
                                                                                                                                                                                                                                                                                    +    # omit all file extensions (js, js.erb, etc.) from the file name
                                                                                                                                                                                                                                                                                    +    Dir[subdir + '/*.js*'].map {|f| File.basename(f)[/^[^.]+/] }.to_json
                                                                                                                                                                                                                                                                                    +  %>,
                                                                                                                                                                                                                                                                                    +<% end %>
                                                                                                                                                                                                                                                                                    +// ... the rest of your ExtJS 4 application definition goes here ...
                                                                                                                                                                                                                                                                                    +});
                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    You now have ExtJS 4’s MVC architecture in Rails 3.1’s asset pipeline. :-)

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Note that, during development, the asset pipeline caches the result of +rendering the app/assets/javascripts/app.js.erb file in memory. As a +result, if you add new files to or remove existing files from the +app/assets/javascripts/app/ directory tree, then you must either (1) +modify the public/javascripts/app.js file and reload your browser or (2) +restart your Rails application (web server) to force the asset pipeline to +render and cache the new output.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Updates


                                                                                                                                                                                                                                                                                    Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                    Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/extracting-archives-without-making-a-mess.html b/extracting-archives-without-making-a-mess.html new file mode 100644 index 0000000..b096d67 --- /dev/null +++ b/extracting-archives-without-making-a-mess.html @@ -0,0 +1,242 @@ +Extracting archives without making a mess - The Terminal Programmer

                                                                                                                                                                                                                                                                                    Extracting archives without making a mess

                                                                                                                                                                                                                                                                                    Suraj N. Kurapati


                                                                                                                                                                                                                                                                                    1. Problem
                                                                                                                                                                                                                                                                                      1. Approach
                                                                                                                                                                                                                                                                                        1. Solution
                                                                                                                                                                                                                                                                                          1. Before the tool
                                                                                                                                                                                                                                                                                            1. After the tool
                                                                                                                                                                                                                                                                                              1. ~/bin/extract-archive
                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Problem

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              It is common practice to place all files related to a single project into +a single directory, and then to make an archive of that directory.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              This practice ensures that the archive does not make a mess of someone’s +working directory when extracted.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Unfortunately, such benevolence cannot always be expected of the archive +creator, so care must be taken by the user to prevent a mess.

                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                              Approach

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Naturally, I automated this process by writing a script which takes care +to always extract an archive neatly into its own subdirectory. This +script remained as an example for my For each File project for a few years. However, I +converted it into Ruby yesterday due to the inability of transforming a +relative path into an absolute one in GNU BASH.

                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                              Solution

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Now, behold the sparkling powers of the extract-archive script, listed +below and available on GitHub, and enjoy +a tidy working directory. :-)

                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                              Before the tool

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Consider the two archives illustrated below.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              $ tree
                                                                                                                                                                                                                                                                                              +.
                                                                                                                                                                                                                                                                                              +|-- good_archive.tar
                                                                                                                                                                                                                                                                                              +`-- evil_archive.tar
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +0 directories, 2 files
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +$ tar tf evil_archive.tar
                                                                                                                                                                                                                                                                                              +bar
                                                                                                                                                                                                                                                                                              +baz
                                                                                                                                                                                                                                                                                              +foo
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +$ tar tf good_archive.tar
                                                                                                                                                                                                                                                                                              +good_archive/
                                                                                                                                                                                                                                                                                              +good_archive/bar
                                                                                                                                                                                                                                                                                              +good_archive/baz
                                                                                                                                                                                                                                                                                              +good_archive/foo
                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Watch what happens to our working directory as we extract them.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              $ tar xf evil_archive.tar
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +$ tree
                                                                                                                                                                                                                                                                                              +.
                                                                                                                                                                                                                                                                                              +|-- bar
                                                                                                                                                                                                                                                                                              +|-- baz
                                                                                                                                                                                                                                                                                              +|-- good_archive.tar
                                                                                                                                                                                                                                                                                              +|-- foo
                                                                                                                                                                                                                                                                                              +`-- evil_archive.tar
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +0 directories, 5 files
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +$ tar xf good_archive.tar
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +$ tree
                                                                                                                                                                                                                                                                                              +.
                                                                                                                                                                                                                                                                                              +|-- bar
                                                                                                                                                                                                                                                                                              +|-- baz
                                                                                                                                                                                                                                                                                              +|-- good_archive
                                                                                                                                                                                                                                                                                              +|   |-- bar
                                                                                                                                                                                                                                                                                              +|   |-- baz
                                                                                                                                                                                                                                                                                              +|   `-- foo
                                                                                                                                                                                                                                                                                              +|-- good_archive.tar
                                                                                                                                                                                                                                                                                              +|-- foo
                                                                                                                                                                                                                                                                                              +`-- evil_archive.tar
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +1 directory, 8 files
                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              The evil archive carelessly littered its contents within our working +directory, whereas the good archive politely placed its contents +into its own subdirectory.

                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                              After the tool

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              $ tree
                                                                                                                                                                                                                                                                                              +.
                                                                                                                                                                                                                                                                                              +|-- good_archive.tar
                                                                                                                                                                                                                                                                                              +`-- evil_archive.tar
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +0 directories, 2 files
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +$ extract.rb *.tar
                                                                                                                                                                                                                                                                                              +extract.rb: `good_archive.tar' ->`./good_archive'
                                                                                                                                                                                                                                                                                              +extract.rb: `evil_archive.tar' ->`./evil_archive.tar+1156637503'
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +$ tree
                                                                                                                                                                                                                                                                                              +.
                                                                                                                                                                                                                                                                                              +|-- good_archive
                                                                                                                                                                                                                                                                                              +|   |-- bar
                                                                                                                                                                                                                                                                                              +|   |-- baz
                                                                                                                                                                                                                                                                                              +|   `-- foo
                                                                                                                                                                                                                                                                                              +|-- good_archive.tar
                                                                                                                                                                                                                                                                                              +|-- evil_archive.tar`-- evil_archive.tar+1156637503
                                                                                                                                                                                                                                                                                              +|-- bar
                                                                                                                                                                                                                                                                                              +|-- baz
                                                                                                                                                                                                                                                                                              +`-- foo
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +2 directories, 8 files
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              ~/bin/extract-archive

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              #!/usr/bin/env ruby
                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                              +# Extracts various compressed and uncompressed file archives (see
                                                                                                                                                                                                                                                                                              +# http://en.wikipedia.org/wiki/List_of_archive_formats) into their
                                                                                                                                                                                                                                                                                              +# *own* output directories so that they do not make a mess by
                                                                                                                                                                                                                                                                                              +# extracting directly into your working directory.
                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                              +# Written in 2003 by Suraj N. Kurapati <https://github.com/sunaku>
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +require 'tmpdir'
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +require 'fileutils'
                                                                                                                                                                                                                                                                                              +include FileUtils::Verbose
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +# Extracts the given source archive relative to the given destination path,
                                                                                                                                                                                                                                                                                              +# and returns the path of the directory containing the extracted contents.
                                                                                                                                                                                                                                                                                              +def extract src_path, dst_path = File.dirname(src_path)
                                                                                                                                                                                                                                                                                              +  src_path = File.expand_path(src_path)
                                                                                                                                                                                                                                                                                              +  src_name = File.basename(src_path)
                                                                                                                                                                                                                                                                                              +  src_suffix = File.extname(src_name)
                                                                                                                                                                                                                                                                                              +  src_prefix = File.basename(src_name, src_suffix)
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +  Dir.mktmpdir(nil, dst_path) do |tmp_dir|
                                                                                                                                                                                                                                                                                              +    # decompress the archive
                                                                                                                                                                                                                                                                                              +    cd tmp_dir do
                                                                                                                                                                                                                                                                                              +      case src_name.sub(/\.part$/, '')
                                                                                                                                                                                                                                                                                              +      when /\.(tar\.gz|tar\.Z|tgz|taz)$/i
                                                                                                                                                                                                                                                                                              +        system 'tar', '-zxf', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(tar\.bz|tar\.bz2|tbz|tbz2)$/i
                                                                                                                                                                                                                                                                                              +        system 'tar', '-jxf', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(tar\.xz|txz)$/i
                                                                                                                                                                                                                                                                                              +        system 'tar', '-Jxf', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(tar|cpio|gem)$/i
                                                                                                                                                                                                                                                                                              +        system 'tar', '-xf', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(tar.lzo|tzo)$/i
                                                                                                                                                                                                                                                                                              +        system "lzop -xc #{src_path.inspect} | tar -xf -"
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(lzo)$/i
                                                                                                                                                                                                                                                                                              +        system 'lzop', '-x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(gz)$/i
                                                                                                                                                                                                                                                                                              +        system "gunzip -c #{src_path.inspect} > #{src_prefix.inspect}"
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(bz|bz2)$/i
                                                                                                                                                                                                                                                                                              +        system "bunzip2 -c #{src_path.inspect} > #{src_prefix.inspect}"
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(shar)$/i
                                                                                                                                                                                                                                                                                              +        system 'sh', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(7z)$/i
                                                                                                                                                                                                                                                                                              +        system '7zr', 'x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(zip)$/i
                                                                                                                                                                                                                                                                                              +        system 'unzip', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(jar)$/i
                                                                                                                                                                                                                                                                                              +        system 'jar', 'xf', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(rz)$/i
                                                                                                                                                                                                                                                                                              +        ln src_path, src_name # rzip removes the archive after extraction
                                                                                                                                                                                                                                                                                              +        system 'rzip', '-d', src_name
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(rar)$/i
                                                                                                                                                                                                                                                                                              +        system 'unrar', 'x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(ace)$/i
                                                                                                                                                                                                                                                                                              +        system 'unace', 'x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(arj)$/i
                                                                                                                                                                                                                                                                                              +        system 'arj', 'x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(arc)$/i
                                                                                                                                                                                                                                                                                              +        system 'arc', 'x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(lhz|lha)$/i
                                                                                                                                                                                                                                                                                              +        system 'lha', 'x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(a|ar)$/i
                                                                                                                                                                                                                                                                                              +        system 'ar', '-x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(Z)$/
                                                                                                                                                                                                                                                                                              +        system "uncompress -c #{src_path.inspect} > #{src_prefix.inspect}"
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(z)$/
                                                                                                                                                                                                                                                                                              +        system "pcat #{src_path.inspect} > #{src_prefix.inspect}"
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(zoo)$/i
                                                                                                                                                                                                                                                                                              +        system 'zoo', 'x//', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(cab)$/i
                                                                                                                                                                                                                                                                                              +        system 'cabextract', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(deb)$/i
                                                                                                                                                                                                                                                                                              +        system 'ar', 'x', src_path
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      when /\.(rpm)$/i
                                                                                                                                                                                                                                                                                              +        system "rpm2cpio #{src_path.inspect} | cpio -i --make-directories"
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +      else
                                                                                                                                                                                                                                                                                              +        warn "I do not know how to extract #{src_path.inspect}"
                                                                                                                                                                                                                                                                                              +      end
                                                                                                                                                                                                                                                                                              +    end
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +    # clean any mess made by decompression
                                                                                                                                                                                                                                                                                              +    manifest = Dir.new(tmp_dir).entries - %w[ . .. ]
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +    if manifest.length == 1 # there was no mess!
                                                                                                                                                                                                                                                                                              +      adj_dst = File.join(dst_path, manifest.first)
                                                                                                                                                                                                                                                                                              +      adj_src = File.join(tmp_dir, manifest.first)
                                                                                                                                                                                                                                                                                              +    else
                                                                                                                                                                                                                                                                                              +      adj_src = tmp_dir
                                                                                                                                                                                                                                                                                              +      adj_dst = File.join(dst_path, src_name[/.*(?=\..*?)/])
                                                                                                                                                                                                                                                                                              +    end
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +    adj_dst << "+#{Time.now.to_i}" until
                                                                                                                                                                                                                                                                                              +      not File.exist? adj_dst and
                                                                                                                                                                                                                                                                                              +      mv(adj_src, adj_dst, :force => true)
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +    touch tmp_dir # give Dir.mktmpdir() something to remove
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +    adj_dst
                                                                                                                                                                                                                                                                                              +  end
                                                                                                                                                                                                                                                                                              +end
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +if $0 == __FILE__
                                                                                                                                                                                                                                                                                              +  prefix = File.basename(__FILE__)
                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              +  ARGV.each do |src|
                                                                                                                                                                                                                                                                                              +    dst = extract(src)
                                                                                                                                                                                                                                                                                              +    puts "#{prefix}: '#{src}' => '#{dst}'"
                                                                                                                                                                                                                                                                                              +  end
                                                                                                                                                                                                                                                                                              +end
                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Updates


                                                                                                                                                                                                                                                                                              Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                              Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/ftv01-la-jetee-effects.html b/ftv01-la-jetee-effects.html new file mode 100644 index 0000000..4462008 --- /dev/null +++ b/ftv01-la-jetee-effects.html @@ -0,0 +1,35 @@ +On the effectiveness of La Jetée - The Terminal Programmer

                                                                                                                                                                                                                                                                                              On the effectiveness of La Jetée

                                                                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                                                                              La Jetée, a film by the French new wave artist Chris Marker, was truly +fascinating because of its clever means of storytelling and its brilliant +ending.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              This film is composed almost wholly of tinted black and white stills. In +particular, the tint used was a pale amber brown, which reminded me of a +rusted sewer pipe wasting away in some ancient drainage system beneath a +modern metropolis. In fact, this kind of feeling suited the film perfectly as +the story took place underground. In this respect, Marker chose an effective +tint for his stills which created an appropriate mood for his film.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              The sound in this film was composed mostly of sound effects and perhaps a +melodious background score during the protagonist’s encounters with the +smiling woman from the past.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              One instance where sound was used effectively was during the protagonist’s +participation in the time-travelling experiment. Here, Marker added ambient +but incomprehensible whispers spoken by the scientists. These whispers +surround and overwhelm the viewer, much like the protagonist is overwhelmed by +the scientists. Had the whispers been comprehensible, the viewer’s attention +would be diverted away from the protagonist and towards the scientists. In +this manner, Marker chose the sound effects well to help the viewer feel the +protagonist’s helplessness.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              The montage in this film is excellent. After the first few images, I no longer +noticed any sharp transitions in the montage. The film gracefully flowed from +one image to other next, as the rich photography drew me into the film’s +world.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              The film’s twist ending was quite brilliant and unexpected. It establishes the +goal of the inward-looking journey of the protagonist, which ironically was +himself, and serves as a very nice dénouement to the plot. That is, in order +to discover who the smiling woman and the mysterious man who was murdered in +his childhood, the protagonist unwittingly embarked on this time-travelling +expedition.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/ftv01-the-power-of-film.html b/ftv01-the-power-of-film.html new file mode 100644 index 0000000..3c17085 --- /dev/null +++ b/ftv01-the-power-of-film.html @@ -0,0 +1,54 @@ +The power of film - The Terminal Programmer

                                                                                                                                                                                                                                                                                              The power of film

                                                                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                                                                              Western culture is notorious for dichotomizing everything: good and bad, black +and white, day and night, left and right, and so on; the list is endless. +Influential films of the early 20th century, specifically D. W. Griffith’s +Birth of a Nation (BON), are characteristic of such dichotomy as they +establish racial and political stereotypes of the day. Fortunately, films of +the early 21st century, such as City of God (COG), are making huge +strides in breaking away from past legacy.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              In BON, the protagonists are the heroic white citizens of the Ku Klux Klan +(KKK) whereas the antagonists, led by their leader who attempts to forcibly +marry a white woman, are a group of African Americans. This story is stale, +cut and dry, and leaves little room for the imagination. That is, it simply +regurgitates social beliefs (racial and political stereotypes) of its day.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              In contrast, COG presents a psychotic antagonist and an optimistic protagonist +who both happen to be of African descent to make the point that it is the +human being who is both good and evil: not a “good” white man against an +“evil” black man. Furthermore, the film portrays this message through various +characters.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              For example, consider the “Tender Trio” who are a group of bandits. Western +culture would paint these men as “evil” or “bad” simply because they are +bandits, but COG shows them in other angles: people who steal but give the +loot to the poor; people who help the underprivileged gain access to basic +necessities like gasoline for cooking and heating water.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Another example is the “runts”. These are children who terrorize and loot +shops in the town, so they are painted as delinquents in Western culture. +However, when they avenge their comrades by killing Zé Pequeño at the end, +they are painted as victors and good citizens for ridding the town of the +gangster menace.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Another example is “Knockout Ned”, the ex-army lieutenant who now works as a +ticket conductor in the local bus routes. Ned is optimistic, friendly, and +serves as a role model for Rocket and his friend when they ride the bus. He +tells the young men that if they study in school and work hard, they can make +it out of the slums and reach a better future: the “American Dream”, if you +will. However, the same Ned becomes a ruthless killer when he joins up with +Carrot’s gang and loots banks. Here, his initial no-killing policy +(representing Western culture’s “good” qualities) changes to killing anyone +who gets in the way (representing Western culture’s “bad” qualities).

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Finally, consider Zé Pequeño himself. Although he is a psychotic menace +according to Western culture, he brought peace to Cidade de Deus for a period +of time when he first took power: an accomplishment few Western politicians +can claim.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              In all these examples, COG demolishes racial and political stereotypes and +brings light to the fact that all humans have both good and bad qualities. +Western culture’s dichotomy is, in fact, a tool used to dehumanize people in +order to cause harm to them whilst maintaining a clear conscience.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              By showing all sides of human nature (greed, compassion, kindness, love, etc.) +COG dispels many stereotypes established by the ever-dichotomizing Western +culture. I feel that the true power of films lies here and sincerely hope that +future films strive to dispel stereotypes and bring light to the ever-complex +and ever-changing face of humanity.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/git-rebase-autocon.html b/git-rebase-autocon.html new file mode 100644 index 0000000..1f757f7 --- /dev/null +++ b/git-rebase-autocon.html @@ -0,0 +1,112 @@ +Automatic merge conflict resolution for git-rebase(1) - The Terminal Programmer

                                                                                                                                                                                                                                                                                              Automatic merge conflict resolution for git-rebase(1)

                                                                                                                                                                                                                                                                                              Suraj N. Kurapati


                                                                                                                                                                                                                                                                                              1. Problem
                                                                                                                                                                                                                                                                                                1. Solution
                                                                                                                                                                                                                                                                                                  1. ~/bin/git-rebase-autocon
                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  Problem

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  Let’s say you have a copy of some software (a clone of a Git repository, to be +precise) that you’ve modified in some way, locally. Some time later, that +software is changed upstream, thereby rendering your local copy out of date. +How can you bring your local copy up to date while also retaining your +local modifications?

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  The answer is to use git-rebase(1). +However, if your local modifications conflict with any upstream changes, then +you’ll need to resolve those conflicts +manually: a cumbersome process that can be daunting for inexperienced users.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  This is particularly problematic for configurable software distributed through +Git, such as my text editor and +window manager configurations, +where the occasional need for manual conflict resolution greatly impedes users +who aren’t technically inclined or lack the time necessary to manually resolve +such conflicts.

                                                                                                                                                                                                                                                                                                  + +

                                                                                                                                                                                                                                                                                                  Solution

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  The following shell script automates conflict resolution for git-rebase(1) by +simply setting aside local modifications that conflict with upstream changes +and by offering users a means of easily undoing such actions, through git +reset --hard.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  Afterwards, the user may choose to inspect the automatically set-aside +conflicts, recorded in empty-tree commits labeled “fixup!”, and restore +portions thereof: thereby enacting manual conflict resolution, but willingly +performed at one’s leisure.

                                                                                                                                                                                                                                                                                                  + +

                                                                                                                                                                                                                                                                                                  ~/bin/git-rebase-autocon

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  #!/bin/sh -e
                                                                                                                                                                                                                                                                                                  +#
                                                                                                                                                                                                                                                                                                  +# Usage: git-rebase-autocon [TARGET] [ARGUMENTS_FOR_GIT_REBASE...]
                                                                                                                                                                                                                                                                                                  +#
                                                                                                                                                                                                                                                                                                  +# Rebases the given TARGET while automatically resolving conflicts
                                                                                                                                                                                                                                                                                                  +# by substituting empty-tree commits labeled "fixup!" that log all
                                                                                                                                                                                                                                                                                                  +# conflicting hunks in their commit messages in git-diff(1) format.
                                                                                                                                                                                                                                                                                                  +#
                                                                                                                                                                                                                                                                                                  +# If TARGET is not specified, the upstream tracking branch is used.
                                                                                                                                                                                                                                                                                                  +# Optional ARGUMENTS_FOR_GIT_REBASE... are passed to git-rebase(1).
                                                                                                                                                                                                                                                                                                  +#
                                                                                                                                                                                                                                                                                                  +# Written in 2010 by Suraj N. Kurapati <https://github.com/sunaku>
                                                                                                                                                                                                                                                                                                  +# Documented at <https://sunaku.github.io/git-rebase-autocon.html>
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +# ensure working tree is clean
                                                                                                                                                                                                                                                                                                  +git rebase HEAD --quiet
                                                                                                                                                                                                                                                                                                  +commit=$(git rev-parse --short HEAD)
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +# parse command-line arguments
                                                                                                                                                                                                                                                                                                  +test $# -gt 0 && target=$1 && shift || target='@{u}'
                                                                                                                                                                                                                                                                                                  +target=$(git name-rev --name-only "$target")
                                                                                                                                                                                                                                                                                                  +target=${target#remotes/}
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +# rebase target and ensure that only merge conflicts made it fail
                                                                                                                                                                                                                                                                                                  +git rebase --fork-point "$target" "$@" && exit || test -d .git/rebase-apply
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +# solve merge conflicts by absorbing leftover commits from prior
                                                                                                                                                                                                                                                                                                  +# versions of the target or by setting aside conflicting commits
                                                                                                                                                                                                                                                                                                  +trap 'git rebase --abort' TERM INT
                                                                                                                                                                                                                                                                                                  +while test -d .git/rebase-apply; do
                                                                                                                                                                                                                                                                                                  +  headline=$(head -1 .git/rebase-apply/final-commit)
                                                                                                                                                                                                                                                                                                  +  conflict=$(cat .git/rebase-apply/original-commit)
                                                                                                                                                                                                                                                                                                  +  shortish=$(git rev-parse --short "$conflict")
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +  # in place of each conflicting commit, record an empty commit whose
                                                                                                                                                                                                                                                                                                  +  # message contains the changes introduced by the conflicting commit
                                                                                                                                                                                                                                                                                                  +  git reset --mixed --quiet # empty the index so we can make a commit
                                                                                                                                                                                                                                                                                                  +  git commit --allow-empty --reuse-message="$conflict" --quiet
                                                                                                                                                                                                                                                                                                  +  {
                                                                                                                                                                                                                                                                                                  +    printf 'fixup! %s %s\n\n' "$shortish" "$headline"
                                                                                                                                                                                                                                                                                                  +    git format-patch --stdout "$conflict~..$conflict"
                                                                                                                                                                                                                                                                                                  +  } |
                                                                                                                                                                                                                                                                                                  +  git commit --amend --allow-empty --file=-
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +  git rebase --skip >/dev/null 2>&1 || :
                                                                                                                                                                                                                                                                                                  +done
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +cat <<END
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +    +-------------------------IMPORTANT!----------------------------+
                                                                                                                                                                                                                                                                                                  +    |                                                               |
                                                                                                                                                                                                                                                                                                  +    | Some of YOUR COMMITS WERE SET ASIDE to solve merge conflicts: |
                                                                                                                                                                                                                                                                                                  +    | empty commits labeled as "fixup!" have now taken their place. |
                                                                                                                                                                                                                                                                                                  +    | But rest assured, THEY STILL EXIST in Git history at $commit, |
                                                                                                                                                                                                                                                                                                  +    | and your working tree has all changes from those commits too! |
                                                                                                                                                                                                                                                                                                  +    |                                                               |
                                                                                                                                                                                                                                                                                                  +    | You can UNDO THIS REBASE at any time by running this command: |
                                                                                                                                                                                                                                                                                                  +    |                                                               |
                                                                                                                                                                                                                                                                                                  +    |                  git reset --hard $commit                     |
                                                                                                                                                                                                                                                                                                  +    |                                                               |
                                                                                                                                                                                                                                                                                                  +    | You can SEE WHAT CHANGED from before by running this command: |
                                                                                                                                                                                                                                                                                                  +    |                                                               |
                                                                                                                                                                                                                                                                                                  +    |                      git diff $commit                         |
                                                                                                                                                                                                                                                                                                  +    |                                                               |
                                                                                                                                                                                                                                                                                                  +    +-------------------------IMPORTANT!----------------------------+
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +END
                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  Updates


                                                                                                                                                                                                                                                                                                  \ No newline at end of file diff --git a/gruvbox-terminal-color-scheme.html b/gruvbox-terminal-color-scheme.html new file mode 100644 index 0000000..6bb43c7 --- /dev/null +++ b/gruvbox-terminal-color-scheme.html @@ -0,0 +1,105 @@ +Gruvbox terminal color scheme - The Terminal Programmer

                                                                                                                                                                                                                                                                                                  Gruvbox terminal color scheme

                                                                                                                                                                                                                                                                                                  Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                  Having used the gorgeous gruvbox color scheme in (Neo)Vim for nearly two +years, I thought: why not use the same colors in my terminal as well? And +thus we have:

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  the color scheme +

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  UNIX manual page +

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  To use this color scheme in hterm, open the nassh extension’s settings page, +open Chrome Developer Tools, and then run the following snippet in the console:

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  term_.prefs_.set("background-color", "#282828");
                                                                                                                                                                                                                                                                                                  +term_.prefs_.set("foreground-color", "#d5c4a1");
                                                                                                                                                                                                                                                                                                  +term_.prefs_.set("cursor-color", "rgba(254,128,25, 0.5)"); /* #fe8019 */
                                                                                                                                                                                                                                                                                                  +term_.prefs_.set("color-palette-overrides", ["#1d2021", "#fb4934", "#b8bb26",
                                                                                                                                                                                                                                                                                                  +"#fabd2f", "#83a598", "#d3869b", "#8ec07c", "#ebdbb2", "#1d2021", "#fb4934",
                                                                                                                                                                                                                                                                                                  +"#b8bb26", "#fabd2f", "#83a598", "#d3869b", "#8ec07c", "#ebdbb2"]);
                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  To use this color scheme in Rxvt or XTerm, save the following snippet to a file +such as ~/.Xdefaults and then run xrdb -merge on that file to apply it. Any +terminals launched thereafter will use this color scheme, but not existing ones.

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  ! Colors from "gruvbox" colorscheme for Vim
                                                                                                                                                                                                                                                                                                  +! https://github.com/morhetz/gruvbox#palette
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +#define Ansi_0_Color     #504945 /* fg2           *//* normal black   */
                                                                                                                                                                                                                                                                                                  +#define Ansi_1_Color     #fb4934 /* red bright    *//* normal red     */
                                                                                                                                                                                                                                                                                                  +#define Ansi_2_Color     #b8bb26 /* green bright  *//* normal green   */
                                                                                                                                                                                                                                                                                                  +#define Ansi_3_Color     #fabd2f /* yellow bright *//* normal yellow  */
                                                                                                                                                                                                                                                                                                  +#define Ansi_4_Color     #83a598 /* blue bright   *//* normal blue    */
                                                                                                                                                                                                                                                                                                  +#define Ansi_5_Color     #d3869b /* purple bright *//* normal magenta */
                                                                                                                                                                                                                                                                                                  +#define Ansi_6_Color     #8ec07c /* aqua bright   *//* normal cyan    */
                                                                                                                                                                                                                                                                                                  +#define Ansi_7_Color     #ebdbb2 /* fg            *//* normal white   */
                                                                                                                                                                                                                                                                                                  +#define Ansi_8_Color     #7c6f64 /* gray          *//* bright black   */
                                                                                                                                                                                                                                                                                                  +#define Ansi_9_Color     #fb4934 /* red bright    *//* bright red     */
                                                                                                                                                                                                                                                                                                  +#define Ansi_10_Color    #b8bb26 /* green bright  *//* bright green   */
                                                                                                                                                                                                                                                                                                  +#define Ansi_11_Color    #fabd2f /* yellow bright *//* bright yellow  */
                                                                                                                                                                                                                                                                                                  +#define Ansi_12_Color    #83a598 /* blue bright   *//* bright blue    */
                                                                                                                                                                                                                                                                                                  +#define Ansi_13_Color    #d3869b /* purple bright *//* bright magenta */
                                                                                                                                                                                                                                                                                                  +#define Ansi_14_Color    #8ec07c /* aqua bright   *//* bright cyan    */
                                                                                                                                                                                                                                                                                                  +#define Ansi_15_Color    #ebdbb2 /* fg            *//* bright white   */
                                                                                                                                                                                                                                                                                                  +#define Bold_Color       #fabd2f /* yellow bright */
                                                                                                                                                                                                                                                                                                  +#define Italic_Color     #d3869b /* purple bright */
                                                                                                                                                                                                                                                                                                  +#define Underline_Color  #8ec07c /* aqua bright   */
                                                                                                                                                                                                                                                                                                  +#define Reverse_Color    #d65d0e /* orange        */
                                                                                                                                                                                                                                                                                                  +#define Foreground_Color #d5c4a1 /* fg2           */
                                                                                                                                                                                                                                                                                                  +#define Background_Color #282828 /* bg0           */
                                                                                                                                                                                                                                                                                                  +#define Cursor_Color     #fe8019 /* orange bright */
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +Rxvt*color0       : Ansi_0_Color/*  normal black   */
                                                                                                                                                                                                                                                                                                  +Rxvt*color1       : Ansi_1_Color/*  normal red     */
                                                                                                                                                                                                                                                                                                  +Rxvt*color2       : Ansi_2_Color/*  normal green   */
                                                                                                                                                                                                                                                                                                  +Rxvt*color3       : Ansi_3_Color/*  normal yellow  */
                                                                                                                                                                                                                                                                                                  +Rxvt*color4       : Ansi_4_Color/*  normal blue    */
                                                                                                                                                                                                                                                                                                  +Rxvt*color5       : Ansi_5_Color/*  normal magenta */
                                                                                                                                                                                                                                                                                                  +Rxvt*color6       : Ansi_6_Color/*  normal cyan    */
                                                                                                                                                                                                                                                                                                  +Rxvt*color7       : Ansi_7_Color/*  normal white   */
                                                                                                                                                                                                                                                                                                  +Rxvt*color8       : Ansi_8_Color/*  bright black   */
                                                                                                                                                                                                                                                                                                  +Rxvt*color9       : Ansi_9_Color/*  bright red     */
                                                                                                                                                                                                                                                                                                  +Rxvt*color10      : Ansi_10_Color/* bright green   */
                                                                                                                                                                                                                                                                                                  +Rxvt*color11      : Ansi_11_Color/* bright yellow  */
                                                                                                                                                                                                                                                                                                  +Rxvt*color12      : Ansi_12_Color/* bright blue    */
                                                                                                                                                                                                                                                                                                  +Rxvt*color13      : Ansi_13_Color/* bright magenta */
                                                                                                                                                                                                                                                                                                  +Rxvt*color14      : Ansi_14_Color/* bright cyan    */
                                                                                                                                                                                                                                                                                                  +Rxvt*color15      : Ansi_15_Color/* bright white   */
                                                                                                                                                                                                                                                                                                  +Rxvt*colorBD      : Bold_Color
                                                                                                                                                                                                                                                                                                  +Rxvt*colorIT      : Italic_Color
                                                                                                                                                                                                                                                                                                  +Rxvt*colorUL      : Underline_Color
                                                                                                                                                                                                                                                                                                  +Rxvt*colorRV      : Reverse_Color
                                                                                                                                                                                                                                                                                                  +Rxvt*foreground   : Foreground_Color
                                                                                                                                                                                                                                                                                                  +Rxvt*background   : Background_Color
                                                                                                                                                                                                                                                                                                  +Rxvt*cursorColor  : Cursor_Color
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +XTerm*color0      : Ansi_0_Color/*  normal black   */
                                                                                                                                                                                                                                                                                                  +XTerm*color1      : Ansi_1_Color/*  normal red     */
                                                                                                                                                                                                                                                                                                  +XTerm*color2      : Ansi_2_Color/*  normal green   */
                                                                                                                                                                                                                                                                                                  +XTerm*color3      : Ansi_3_Color/*  normal yellow  */
                                                                                                                                                                                                                                                                                                  +XTerm*color4      : Ansi_4_Color/*  normal blue    */
                                                                                                                                                                                                                                                                                                  +XTerm*color5      : Ansi_5_Color/*  normal magenta */
                                                                                                                                                                                                                                                                                                  +XTerm*color6      : Ansi_6_Color/*  normal cyan    */
                                                                                                                                                                                                                                                                                                  +XTerm*color7      : Ansi_7_Color/*  normal white   */
                                                                                                                                                                                                                                                                                                  +XTerm*color8      : Ansi_8_Color/*  bright black   */
                                                                                                                                                                                                                                                                                                  +XTerm*color9      : Ansi_9_Color/*  bright red     */
                                                                                                                                                                                                                                                                                                  +XTerm*color10     : Ansi_10_Color/* bright green   */
                                                                                                                                                                                                                                                                                                  +XTerm*color11     : Ansi_11_Color/* bright yellow  */
                                                                                                                                                                                                                                                                                                  +XTerm*color12     : Ansi_12_Color/* bright blue    */
                                                                                                                                                                                                                                                                                                  +XTerm*color13     : Ansi_13_Color/* bright magenta */
                                                                                                                                                                                                                                                                                                  +XTerm*color14     : Ansi_14_Color/* bright cyan    */
                                                                                                                                                                                                                                                                                                  +XTerm*color15     : Ansi_15_Color/* bright white   */
                                                                                                                                                                                                                                                                                                  +XTerm*colorBD     : Bold_Color
                                                                                                                                                                                                                                                                                                  +XTerm*colorIT     : Italic_Color
                                                                                                                                                                                                                                                                                                  +XTerm*colorUL     : Underline_Color
                                                                                                                                                                                                                                                                                                  +XTerm*colorRV     : Reverse_Color
                                                                                                                                                                                                                                                                                                  +XTerm*foreground  : Foreground_Color
                                                                                                                                                                                                                                                                                                  +XTerm*background  : Background_Color
                                                                                                                                                                                                                                                                                                  +XTerm*cursorColor : Cursor_Color
                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  +! enable coloring for bold and underlined text
                                                                                                                                                                                                                                                                                                  +XTerm*vt100.boldColors     : False
                                                                                                                                                                                                                                                                                                  +XTerm*vt100.colorBDMode    : True
                                                                                                                                                                                                                                                                                                  +XTerm*vt100.colorULMode    : True
                                                                                                                                                                                                                                                                                                  +XTerm*vt100.colorRVMode    : False
                                                                                                                                                                                                                                                                                                  +XTerm*vt100.veryBoldColors : 6
                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  Updates


                                                                                                                                                                                                                                                                                                  Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                  Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  \ No newline at end of file diff --git a/guiltless-monkeypatching-with-uuid.html b/guiltless-monkeypatching-with-uuid.html new file mode 100644 index 0000000..5837b18 --- /dev/null +++ b/guiltless-monkeypatching-with-uuid.html @@ -0,0 +1,36 @@ +Guiltless monkeypatching with UUID - The Terminal Programmer

                                                                                                                                                                                                                                                                                                  Guiltless monkeypatching with UUID

                                                                                                                                                                                                                                                                                                  Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                  1. Example in Ruby

                                                                                                                                                                                                                                                                                                    Feeling guilty about +monkeypatching? Then free +yourself from fear of name collisions and peer ridicule by naming your +monkeypatched constructs with universally unique identifiers +(UUIDs) and +be finally at peace with your inner, monkeypatching self!

                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                    uuidgen | sed 'y/-/_/; s/^/_/'
                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                    The above command generates a UUID that conforms to /^\w+$/ and is +therefore ready for use in mainstream programming languages today.

                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                    Example in Ruby

                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                    Although you would typically monkeypatch in Ruby like this:

                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                    class Array
                                                                                                                                                                                                                                                                                                    +  alias __inspect__ inspect
                                                                                                                                                                                                                                                                                                    +  def inspect
                                                                                                                                                                                                                                                                                                    +    "<MonkeyPatchedArray:#{__inspect__}>"
                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                    +[1, 2, 3].inspect #=> "<MonkeyPatchedArray:[1, 2, 3]>"
                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                    You can achieve the same effect, without guilt, like this:

                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                    class Array
                                                                                                                                                                                                                                                                                                    +  alias _fba86586_e89d_4ed4_ba5c_395776a674b3 inspect
                                                                                                                                                                                                                                                                                                    +  def inspect
                                                                                                                                                                                                                                                                                                    +    "<GuiltlesslyMonkeyPatchedArray(#{
                                                                                                                                                                                                                                                                                                    +      _fba86586_e89d_4ed4_ba5c_395776a674b3
                                                                                                                                                                                                                                                                                                    +    })>"
                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                    +[1, 2, 3].inspect #=> "<GuiltlesslyMonkeyPatchedArray([1, 2, 3])>"
                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/his29-essay1.html b/his29-essay1.html new file mode 100644 index 0000000..98e5836 --- /dev/null +++ b/his29-essay1.html @@ -0,0 +1,180 @@ +Major changes in South Asian rituals in 1500-500 BCE - The Terminal Programmer

                                                                                                                                                                                                                                                                                                    Major changes in South Asian rituals in 1500-500 BCE

                                                                                                                                                                                                                                                                                                    Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                    1. Abstract
                                                                                                                                                                                                                                                                                                      1. 1 Introduction
                                                                                                                                                                                                                                                                                                        1. 1.1 Vedic Rituals
                                                                                                                                                                                                                                                                                                          1. 1.2 Upanishads
                                                                                                                                                                                                                                                                                                            1. 1.3 Buddhism
                                                                                                                                                                                                                                                                                                              1. 1.4 Jainism
                                                                                                                                                                                                                                                                                                              2. 2 Major Changes
                                                                                                                                                                                                                                                                                                                1. 2.1 Cosmology and Sacrifice
                                                                                                                                                                                                                                                                                                                  1. 2.2 Ethics and the After-Life
                                                                                                                                                                                                                                                                                                                    1. 2.3 Suffering and Liberation
                                                                                                                                                                                                                                                                                                                    2. 3 Conclusion
                                                                                                                                                                                                                                                                                                                      1. References
                                                                                                                                                                                                                                                                                                                        1. Footnotes
                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          Abstract

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          A brief account of major south Asian Vedic, Upanishadic, Buddhist, and Jainist +rituals and their changes during 1500-500 BCE is given in this article. In +particular, there is an overall shift from a utilitarian to a respect-for- +persons ethical perspective in the belief systems as time progresses.

                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          1 Introduction

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          The following sections outline major Vedic, Upanishadic, Buddhist, and Jainist +rituals during the 1500-500 BCE period. Once these rituals have been +introduced, a brief account of their major changes is given in Section 2.

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          Keep in mind that the chronological order (from most ancient to most recent) +in which these belief systems emerged is roughly [1]:

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          1. Vedism
                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                          3. Upanishadism (Asceticism)
                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                          5. Buddhism and Jainism
                                                                                                                                                                                                                                                                                                                          6. +
                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          1.1 Vedic Rituals

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          The most important Vedic ritual is the sacrifice [1], which is said (by +brahmins) to maintain the universal order while preventing “chaos and +calamity” [1]. This ritual is organized by wealthy sponsors who make +preparations for [1]:

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          • a spacious, reserved area of land upon which the ritual will be performed
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • the slaughter of many animals upon which the participants feast
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • a generous supply of the soma plant for creation of the soma drink
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • a fire (agni) through which the gods are summoned [2, p. 44]
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • numerous brahmins (specialists who chant the sacred Vedas and facilitate the sacrifice)
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          During the sacrifice, brahmins chant the sacred Vedas and invite the gods +to join them. Concurrently, animals are slaughtered and a generous supply of +soma drink is created from the soma plant [1]. Next, the gods arrive from +the heavens and join the participants (brahmins, the sponsors of the +sacrifice [1], and sometimes entire villages or tribes [2, p. 44]) in feasting +on the freshly slaughtered animals and indulging in the hallucination- +inducing1 soma drink [1]. Finally, the sacrifice is often concluded with +plentiful acts of sexual intercourse (commended by soma, the warrior God) +amongst the participants [1].

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          As [1] eloquently states, the Vedic sacrifice can be summarized as “eat, +drink, and be merry.”

                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          1.2 Upanishads

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          The primary ritualistic focus of the Upanishads is to facilitate the +attainment of knowledge and understanding [1]. Thus, the Upanishads brought +about significant scientific and philosophical development.

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          Major Upanishadic rituals are [1]:

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          • rejecting the Vedic sacrifice and varna system
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • upholding of virtues: ahimsa (non-violence), satya (honesty), etc.
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • regular practice of asceticism and meditation
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • rejecting materialism and living a simple life
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          1.3 Buddhism

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          The primary ritualistic focus of Buddhism is to become liberated (nirodha) +from the cycle of rebirth (samsara) and from suffering (dukkha) induced by +desires [1]. Thus, major Buddhist rituals are [1]:

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          • following the eight-fold path
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • practicing the four noble truths
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • renouncing worldly possessions and status
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • living a simple life (similar to Asceticism)
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • following the middle path (madhyama) or practising moderation
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          1.4 Jainism

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          Similar to Buddhism, the primary ritualistic focus of Jainism is to become +liberated from the cycle of rebirth (samsara) [1]. However, in contrast to +Buddhism, the practice of non-violence (ahimsa) is given top priority in +Jainism [1]. Thus, major Jainist rituals are [1]:

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          • practicing non-violence (ahimsa) for all forms of life
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • renouncing worldly possessions and status
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • living a simple life (similar to Asceticism)
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          2 Major Changes

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          The following sections outline major changes and trends in concepts +fundamental to the belief systems under discussion.

                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          2.1 Cosmology and Sacrifice

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          During the heyday of the Vedic period, we see mass performances of the Vedic +sacrifice because Vedic worshippers believed that proper performance of said +rituals maintains the order of the universe [1], [2, p. 45]. However, towards +the end of the Vedic period, when Upanishadic influence had established +itself, we see questioning of earlier Vedic theories of cosmology–namely, +that the universe resulted from the great Vedic sacrifice of the primeval +being named purusha or prajaapati [1], [2, p. 45], [3, p. 35]. For +example, [2, p. 45] shows an interesting quotation which illustrates such +questioning:

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          But, after all, who knows, and who can say,
                                                                                                                                                                                                                                                                                                                          +Whence it all came, and how creation happened?
                                                                                                                                                                                                                                                                                                                          +The gods themselves are later than creation,
                                                                                                                                                                                                                                                                                                                          +So who knows truly whence it has arisen?

                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          This quotation also shows a decline in the power of the Vedic gods because it +suggests that they are secondary to some unmentioned entity which created the +Vedic gods. This unmentioned entity might be the Upanishadic brahman, which +transcends the universe and everything in it (including the Vedic gods).

                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          2.2 Ethics and the After-Life

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          The early Vedic worshippers (associated with the Rig Veda) were not concerned +with the after-life [1] whereas the Upanishads, Buddhism, and Jainism were. +This concern in the latter belief systems emerged from the Upanishadic +concepts of the seven underworlds [1], [3, p. 48]; seven heavens [1], [3, p. +46]; and the numerous hells [1], [3, p. 49]. In the concept of the hells, +Upanishadists believed that they would be punished in one or more hells by the +God yama according to their kharma2 or conduct [1], [3, p. 49-52]. That +is, if one exhibits bad (violent, materialistic, etc.) conduct before one +dies, then one will be punished accordingly by God yama [1].

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          The new, Upanishadic idea of kharma heavily influenced Buddhism and Jainism +for they too stress the importance of proper ethical conduct-however, the +latter use it as a stepping stone in achieving liberation from the cycle of +rebirth [1].

                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          2.3 Suffering and Liberation

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          Upanishadism, Buddhism, and Jainism all promote the goal of being liberated +from the cycle of rebirth, but they do so in slightly different ways. For +example, consider the following distinctions.

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          • Upanishadism focuses on knowledge and understanding of the brahman in achieving moksha or liberation [1].
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • Buddhism sees life as suffering and focuses on avoidance of suffering by achieving nirvaana or liberation [1].
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • Jainism focuses on absolute practice of ahimsa to all forms of life in achieving liberation [1].
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          Here we see a shift in goals from knowledge oriented Upanishadism to +prevention of suffering in Buddhism and Jainism. Thus, the human condition or +circumstance is given more importance as we move in time towards 500 BCE.

                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          3 Conclusion

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          As we move chronologically from 1500 BCE to 500 BCE, we see a shift-more or +less-from a utilitarian to a respect-for-persons ethical perspective or +concern for the human condition. That is, the people of this time period +became less concerned with actively maintaining the order of the universe and +focused on improving their personal or inter-personal circumstance. This shift +also brought about greater importance on personal responsibility in exhibiting +and practicing proper3 ethical conduct.

                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          References

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          1. D. Basu, “History 29: Traditional Histories of India,” presented at University of California, Santa Cruz, CA, March-June 2005.

                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                          3. R. Thapar, A History of India, vol. 1, Chippenham, Wiltshire, Great Britain: Penguin Books, 1966.

                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                          5. C. Dimmit and J.A.B. van Buitenen, Classical Hindu Mythology: A Reader in the Sanskrit Puranas, Philadelphia, PA: Temple University Press, 1978.

                                                                                                                                                                                                                                                                                                                          6. +
                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                          Footnotes

                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                          1. +

                                                                                                                                                                                                                                                                                                                            Upon ingesting the soma drink, participants are said to experience fantastic visions; uplifting, incredible, superhuman sensations; and a desire to engage in sexual intercourse [1]. 

                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          2. + +
                                                                                                                                                                                                                                                                                                                          3. +

                                                                                                                                                                                                                                                                                                                            The Upanishadic version of kharma is different from that of Vedism, for the latter used the term to justify the varna or caste system [1], [2, p. 46]. 

                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          4. + +
                                                                                                                                                                                                                                                                                                                          5. +

                                                                                                                                                                                                                                                                                                                            Each belief system under discussion has its own respective idea of what is proper or good ethical conduct. 

                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          6. + +
                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/his29-essay2.html b/his29-essay2.html new file mode 100644 index 0000000..c911f73 --- /dev/null +++ b/his29-essay2.html @@ -0,0 +1,152 @@ +Vedic and Upanishadic influence in the Bhagavadh Giitha - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                          Vedic and Upanishadic influence in the Bhagavadh Giitha

                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                          1. Introduction
                                                                                                                                                                                                                                                                                                                            1. Vedic Influence
                                                                                                                                                                                                                                                                                                                              1. Upanishadic Influence
                                                                                                                                                                                                                                                                                                                                1. Conclusion
                                                                                                                                                                                                                                                                                                                                  1. References
                                                                                                                                                                                                                                                                                                                                    1. Footnotes

                                                                                                                                                                                                                                                                                                                                      In the Bhagavadh Giitha1, Krishna draws upon and transforms the central tenets +of Vedic and Upanishadic philosophy while defining his own [1]. In particular, +he skillfully transforms the concepts of Aathman2, Brahman, Samsaara, Kharma, +Dharma, and Moksha into two primary forms of discipline: Yoga and Bhakthi.

                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                      Introduction

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Yoga, defined as an act or state of morality and contemplation [1], is the +primary vehicle which delivers one from chaos, ignorance, and the cycle of +rebirth into peace, wisdom, and the infinite spirit according to Krishna [2]. +Bhakthi, defined as devotion [1], is the religious aspect of Krishna’s +dialogue in the Bhagavadh Giitha through which one becomes detached from +desires, delusions, emotion, and acts of consciousness through thinking, +praying, and meditating on the Gods [1, 2]. Yoga and Bhakthi should not be +thought of as being two disjoint, unrelated concepts, for as Krishna explains +[2, p. 67]:

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      The self tranquil, his fear dispelled,
                                                                                                                                                                                                                                                                                                                                      +firm in his vow of celibacy, his mind restrained,
                                                                                                                                                                                                                                                                                                                                      +let him sit with discipline,
                                                                                                                                                                                                                                                                                                                                      +his thought fixed upon me, intent on me.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Here, the first three lines refer to Yoga while the last line refers to +Bhakthi. One can see that Yoga is essential to performing Bhakthi optimally, +and performance of Bhakthi enhances one’s Yoga because one’s mind is +indifferent to environmental and personal influences when all of one’s +thoughts are fixed away, upon something. Thus, in the subsequent discussion, +one should keep in mind that whenever Yoga is detailed, Bhakthi is also +detailed implicitly; and vice versa.

                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                      Vedic Influence

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      The Vedic concepts of Samsaara, Kharma, and Dharma are well supported in the +Bhagavadh Giitha with numerous examples of social and personal +responsibilities. For example, when Arjuna—dejected by the sight of his +kinsmen ready to battle against him [2, p. 27–29]—is unwilling to fight, he +says [2, p. 29]:

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      The sins of men who violate
                                                                                                                                                                                                                                                                                                                                      +the family create disorder in society
                                                                                                                                                                                                                                                                                                                                      +that undermines the constant laws
                                                                                                                                                                                                                                                                                                                                      +of caste and family duty.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Here we see clearly the influence of Vedic Kharma in the phrase “the constant +laws of caste and family duty,” because Vedic Kharma was used to support the +caste system of the four Varnas [1]. Influence of Vedic Samsaara is also +present with this quotation’s reference to bringing disorder as a sin, because +it was believed in Vedic culture that without performance of Vedic fire +sacrifices, the world would go into chaos and calamity [1]—an undesirable +event in Vedic philosophy [1]. Finally, Vedic Dharma is present as Krishna +encourages Arjuna to selflessly perform and fulfill his duties as a warrior +because such is a warrior’s Dharma [2, p. 36]:

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      nothing is better for a warrior
                                                                                                                                                                                                                                                                                                                                      +than a battle of sacred duty.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      In fact, Arjuna’s reluctance to perform his warrior’s Dharma is the very +problem the Bhagavadh Giitha strives to resolve.

                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                      Upanishadic Influence

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      The Upanishadic concepts of Aathman, Brahman, and Moksha are well supported +through the treatment of numerous philosophical questions, concepts, and +abstract thought in the Bhagavadh Giitha, primarily because the Upanishads +themselves dealt with such abstract, philosophical concepts [1, 4, 3].

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Aathman, or the inner self, is described by Krishna when he philosophically +encourages Arjuna to follow his warrior’s Dharma by explaining that the +Aathman cannot be killed [2, p. 34]:

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Arjuna, when a man knows the self
                                                                                                                                                                                                                                                                                                                                      +to be indestructible, enduring, unborn,
                                                                                                                                                                                                                                                                                                                                      +unchanging, how does he kill
                                                                                                                                                                                                                                                                                                                                      +or cause anyone to kill?

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      In this manner, Krishna motivates the practice of Dharma and Yoga because the +self has nothing to lose, so to speak. That is, even if one dies while +practicing one’s Dharma and Yoga, one’s self persists nevertheless [2, p. 71]:

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Fallen in discipline, he reaches
                                                                                                                                                                                                                                                                                                                                      +worlds made by his virtue, wherein he dwells
                                                                                                                                                                                                                                                                                                                                      +for endless years, until he is reborn
                                                                                                                                                                                                                                                                                                                                      +in a house of upright and noble men.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Brahman, or the infinite spirit, is thoroughly discussed in the eighteenth +teaching of the Bhagavadh Giitha. Here, Krishna hints about the Upanishadic +origin of Brahman when he describes it as “the state ascetics enter, freed +from passion,” [2, p. 81]—the Upanishads were developed by ascetics [1]—and +states that one can invoke it via the “eternal syllable OM” [2, p. 81]—the +Vedic eternal syllable consisted only of the letter O until the Upanishads +appended the letter M onto it [1]. In addition, Krishna frequently connects +Brahman to Yoga for he states that one requires discipline to reach Brahman +[2, p. 80]:

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Disciplined through practice,
                                                                                                                                                                                                                                                                                                                                      +his reason never straying,
                                                                                                                                                                                                                                                                                                                                      +meditating, one reaches
                                                                                                                                                                                                                                                                                                                                      +the supreme divine spirit of man.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Moksha, or liberation from the cycle of rebirth [1], is described by Krishna +when he says [2, p. 80]:

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      with the mind immovable,
                                                                                                                                                                                                                                                                                                                                      +armed with devotion
                                                                                                                                                                                                                                                                                                                                      +[…]
                                                                                                                                                                                                                                                                                                                                      +one attains the supreme
                                                                                                                                                                                                                                                                                                                                      +divine spirit of man.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Here, Krishna relates Moksha to Yoga in the first line by requiring that only +those who possess complete mental resolve through Yoga can achieve Moksha. +Similarly, he relates Moksha to Bhakthi in the second line by requiring that +only those with complete devotion can achieve Moksha.

                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                      Conclusion

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      As we have seen through various examples, the central tenets of Vedic and +Upanishadic philosophy are borrowed from heavily and incorporated in the +Bhagavadh Giitha; particularly in describing Bhakthi and Yoga, the two primary +forms of discipline.

                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                      References

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      1. D. Basu, “History 29: Traditional Histories of India,” presented at University of California, Santa Cruz, CA, March–June 2005.

                                                                                                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                                                                                                      3. B. S. Miller, The Bhagavad-Gita: Krishna’s Counsel in Time of War, New York, NY: Bantam Dell, 2004.

                                                                                                                                                                                                                                                                                                                                      4. +
                                                                                                                                                                                                                                                                                                                                      5. C. Dimmit and J.A.B. van Buitenen, Classical Hindu Mythology: A Reader in the Sanskrit Puranas, Philadelphia, PA: Temple University Press, 1978.

                                                                                                                                                                                                                                                                                                                                      6. +
                                                                                                                                                                                                                                                                                                                                      7. R. Thapar, A History of India, vol. 1, Chippenham, Wiltshire, Great Britain: Penguin Books, 1966.

                                                                                                                                                                                                                                                                                                                                      8. +
                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                      Footnotes

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                      1. +

                                                                                                                                                                                                                                                                                                                                        “ii” in Giitha, as “ee” in free

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      2. + +
                                                                                                                                                                                                                                                                                                                                      3. +

                                                                                                                                                                                                                                                                                                                                        “aa” in Aathman, as “a” in far. 

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      4. + +
                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      \ No newline at end of file diff --git a/home-row-mods.html b/home-row-mods.html new file mode 100644 index 0000000..f47e58b --- /dev/null +++ b/home-row-mods.html @@ -0,0 +1,459 @@ +Taming home row mods with bilateral combinations - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                      Taming home row mods with bilateral combinations

                                                                                                                                                                                                                                                                                                                                      Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                      For the past 2 years, I’ve used home row mods designed by the legendary +Miryoku, where the Super, Alt, Control, and Shift modifier keys are embedded +in the home row as dual role “mod-tap” keys through my programmable keyboard’s QMK firmware.

                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Home row and standard modifiers on a typical 60% keyboard. +

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      These keys behave normally when tapped, sending their assigned character (such as +the letter “A”) to the computer. But when held, they become modifier keys, +sending their assigned modifier (such as Alt or Shift) to the computer instead.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      This literally puts all modifier keys at your fingertips, thereby eliminating +the need to move your fingers away from the home row to reach them.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      1. Problem
                                                                                                                                                                                                                                                                                                                                        1. Same-hand chords
                                                                                                                                                                                                                                                                                                                                          1. Dual-hand chords
                                                                                                                                                                                                                                                                                                                                            1. Typing streaks
                                                                                                                                                                                                                                                                                                                                            2. Solution
                                                                                                                                                                                                                                                                                                                                              1. Patches
                                                                                                                                                                                                                                                                                                                                                1. Example
                                                                                                                                                                                                                                                                                                                                                  1. rules.mk
                                                                                                                                                                                                                                                                                                                                                    1. config.h
                                                                                                                                                                                                                                                                                                                                                    2. Usage
                                                                                                                                                                                                                                                                                                                                                      1. Allowing same-sided combinations
                                                                                                                                                                                                                                                                                                                                                        1. Allowing crossover combinations
                                                                                                                                                                                                                                                                                                                                                          1. Delaying modifier activation
                                                                                                                                                                                                                                                                                                                                                            1. Suppressing modifiers while typing
                                                                                                                                                                                                                                                                                                                                                          2. Porting to ZMK
                                                                                                                                                                                                                                                                                                                                                            1. Bilateral combinations enforcement
                                                                                                                                                                                                                                                                                                                                                              1. Snippet

                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Problem

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              The main issue with home row mods is the unintended activation of modifiers. +When typing quickly, I sometimes press keys together like a piano chord instead +of tapping and releasing keys individually like distinct notes on a piano scale. +This can activate home row mods and trigger unwanted shortcuts on my computer, +such as launching an app, closing a window, or sending an unfinished e-mail. 😱

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Over time, the negative feedback from these misfires has trained me to type more +slowly and thoughtfully, burdening my mind with uncertainty that impedes my +natural typing rhythm and unconscious flow of thoughts onto the computer screen.

                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Same-hand chords

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              When typing the word “clock” in the Engram layout, I tend to chord “ck” +by first holding down “c” with my left pinky finger, tapping “k” with my left +index finger, and finally releasing them both simultaneously or in the reverse order.

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Same-hand chord "ck" in the word "clock". +

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Miryoku’s experimental “bilateral combinations” feature attempts to solve +this problem by suppressing home row mods for chords that begin and end on the +same side of the keyboard. This way, it only affects home row mods for chords that +cross over to the other side of the keyboard; so they’re bilateral combinations.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              However, it has a longstanding bug called “flashing mods” where +the Super key would always be sent to the computer for same-hand chords, even +though their home row mods should be suppressed. This makes me accidentally +trigger the Start Menu when typing words like “clock” and “sock” due to my “ck” +chording tendency.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              With sleepless determination, I recently fixed this and contributed a patch.

                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Dual-hand chords

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              When typing the word “end” in the Engram layout, I tend to chord the +entire word by first holding down “e” with my left middle finger and then holding +down “n” with right pinky finger, before finally tapping “d” with my right middle +finger. The first two keys essentially form a stable base from which the third +can be reached. Similarly, I chord “est” in the same way when typing the word +“best”.

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Dual-hand chord "en" and same-hand chord "nd" in the word "end". +

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Thanks to the increased typing speed made possible by my “flashing mods” patch +for same-hand chords, I was able to make the above +observations which revealed a blind spot in Miryoku’s bilateral combinations +concept: it only intercepts same-hand home row mods and completely ignores +the dual-handed ones!

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              This seemed like the key to solving the problem, so I plunged in with more +sleepless determination and created a new feature called “crossover” bilateral +combinations to intercept fast “rolls” that cross over the +left/right boundary.

                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Typing streaks

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              When typing the word “stress” in the Engram layout, I tend to chord the +end of the word (after typing “str”) by first holding down “e” with my left +middle finger and then tapping “s” with right ring finger twice. If done too slowly, +this will trigger the “es” bilateral combination (which sends the Ctrl-S +shortcut to the computer, in my case) instead of tapping “e” and “s” separately.

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Dual-hand chord "es" and key repetition in the word "stress". +

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              There is a brilliant solution to this problem in ZMK’s global-quick-tap +feature, which cleverly suppresses modifiers during periods of +active typing. For instance, in the example above, I tap “r” immediately before +the “es” chord: thus, by measuring the amount of time that has passed between the +tap and chord, we can detect whether the chord occurred within a typing streak +and suppress it!

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Duly inspired, I’ve implemented this idea in QMK via a configurable typing +streak timeout setting that automatically suppresses home row mods while typing:

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              #define BILATERAL_COMBINATIONS_TYPING_STREAK_TIMEOUT 160 /* milliseconds */
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              However, this tends to obstruct the Shift modifier when typing parentheses or +punctuation marks such as ! and ? at the end of a sentence; and it requires a +dedicated Shift key as a workaround, per @urob’s “timeless” mods for +ZMK. So I went further +and exempted Shift modifiers from typing streaks in a bitwise mask:

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              #define BILATERAL_COMBINATIONS_TYPING_STREAK_MODMASK (~MOD_MASK_SHIFT)
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              And so, with all this, typing feels natural again! No more unconscious fears +about accidentally triggering home row mods. 😌 It’s a complete game changer! 🤩

                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Solution

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Armed with my patches for the aforementioned problems, I have finally tamed home +row mods! But how does it even work, you ask? Well, it’s all quite coincidental:

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Can’t see SVG image? Try the PNG image, PDF document, or source file. + +Flowchart: Miryoku's flowchart Combinations for Home Row Mods in QMK +

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Three main user actions drive the logic: tapping, holding, and releasing keys. +Everything happens depending on what keys they hold and how long they hold them.

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              • The green hexagons are external events representing a user’s actions.
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • The blue ovals are a chord’s main stages of life: begin, extend, end.
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • The pink folders are #define settings, documented individually below.
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • The yellow components are QMK functions, which I treat as system calls.
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • The gray boxes are internal storage mutations that track state changes.
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Patches

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Apply the following patch or check out a ready-to-use branch or working example.

                                                                                                                                                                                                                                                                                                                                                              + + +

                                                                                                                                                                                                                                                                                                                                                              This patch supersedes my previous patches, listed below, by adding support for +chord tapping (multiple mod keys) and “eager mods” for mod-click mouse usage.

                                                                                                                                                                                                                                                                                                                                                              + + + +

                                                                                                                                                                                                                                                                                                                                                              Example

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Below are the relevant parts of my configuration that put everything in action, producing the best typing experience I’ve felt +since adopting Miryoku. Enjoy! 😎

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              rules.mk

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              DEFERRED_EXEC_ENABLE = yes
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              config.h

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              /* QMK */
                                                                                                                                                                                                                                                                                                                                                              +#define TAPPING_TERM 200
                                                                                                                                                                                                                                                                                                                                                              +#define IGNORE_MOD_TAP_INTERRUPT /* for rolling on mod-tap keys */
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +/* Miryoku */
                                                                                                                                                                                                                                                                                                                                                              +#define BILATERAL_COMBINATIONS
                                                                                                                                                                                                                                                                                                                                                              +#define BILATERAL_COMBINATIONS_LIMIT_CHORD_TO_N_KEYS 4 /* GUI, Alt, Ctrl, Shift */
                                                                                                                                                                                                                                                                                                                                                              +#define BILATERAL_COMBINATIONS_DELAY_MODS_THAT_MATCH MOD_MASK_GUI
                                                                                                                                                                                                                                                                                                                                                              +#define BILATERAL_COMBINATIONS_DELAY_MATCHED_MODS_BY 120  /* ms */
                                                                                                                                                                                                                                                                                                                                                              +#define BILATERAL_COMBINATIONS_ALLOW_CROSSOVER_AFTER 80   /* ms */
                                                                                                                                                                                                                                                                                                                                                              +#define BILATERAL_COMBINATIONS_ALLOW_SAMESIDED_AFTER 3000 /* ms */
                                                                                                                                                                                                                                                                                                                                                              +#define BILATERAL_COMBINATIONS_TYPING_STREAK_TIMEOUT 160  /* ms */
                                                                                                                                                                                                                                                                                                                                                              +#define BILATERAL_COMBINATIONS_TYPING_STREAK_MODMASK (~MOD_MASK_SHIFT)
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Usage

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              To enable bilateral combinations:

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              1. Add the following line to your config.h file:

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                #define BILATERAL_COMBINATIONS
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                              3. Add the following line to your rules.mk file to enable QMK’s deferred execution facility.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                DEFERRED_EXEC_ENABLE = yes
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Allowing same-sided combinations

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              To enable same-sided combinations (which start on one side of the keyboard and end on the same side, such as RSFT_T(KC_J) and RCTL_T(KC_K) in the abbreviation “jk” which stands for “just kidding”), add the following line to your config.h and define a value: hold times greater than that value will permit same-sided combinations.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              For example, if you typed RSFT_T(KC_J) and RCTL_T(KC_K) faster than the defined value, the keys KC_J and KC_K would be sent to the computer. In contrast, if you typed slower than the defined value, the keys RSFT(KC_K) would be sent to the computer.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              #define BILATERAL_COMBINATIONS_ALLOW_SAMESIDED_AFTER 500
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Allowing crossover combinations

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              To enable crossover bilateral combinations (which start on one side of the keyboard and cross over to the other side, such as RSFT_T(KC_J) and LGUI_T(KC_A) in the word “jam”), add the following line to your config.h and define a value: hold times greater than that value will permit crossover bilateral combinations.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              For example, if you typed RSFT_T(KC_J) and LGUI_T(KC_A) faster than the defined value, the keys KC_J and KC_A would be sent to the computer. In contrast, if you typed slower than the defined value, the keys RSFT(KC_A) would be sent to the computer.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              #define BILATERAL_COMBINATIONS_ALLOW_CROSSOVER_AFTER 75
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Delaying modifier activation

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              To delay the registration of certain modifiers (such as KC_LGUI and KC_RGUI, which are considered to be “flashing mods” because they suddenly “flash” or pop up the “Start Menu” in Microsoft Windows) during bilateral combinations, you can define a BILATERAL_COMBINATIONS_DELAY_MODS_THAT_MATCH setting specifying which modifiers should be delayed, and a BILATERAL_COMBINATIONS_DELAY_MATCHED_MODS_BY setting specifying how long that delay (measured in milliseconds) should be.

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              1. Add the following line to your config.h and define a bitwise mask that matches the modifiers you want to delay. For example, here we are defining the mask to only match the GUI and ALT modifiers.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                #define BILATERAL_COMBINATIONS_DELAY_MODS_THAT_MATCH (MOD_MASK_GUI|MOD_MASK_ALT)
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                              3. Add the following line to your config.h and define a timeout value (measured in milliseconds) that specifies how long modifiers matched by BILATERAL_COMBINATIONS_DELAY_MODS_THAT_MATCH should be delayed. For example, here we are defining the timeout to be 100 milliseconds long.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                #define BILATERAL_COMBINATIONS_DELAY_MATCHED_MODS_BY 100
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Suppressing modifiers while typing

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              To suppress mod-tap holds within a typing streak, add the following line to your config.h and define a timeout value: a typing streak ends when this much time passes after the last key in the streak is tapped. Until such time has passed, mod-tap holds are converted into regular taps. The default value of this definition is 0, which disables this feature entirely. Overall, this feature is similar in spirit to ZMK’s global-quick-tap feature.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              #define BILATERAL_COMBINATIONS_TYPING_STREAK_TIMEOUT 175
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              If you wish to target only certain modifiers (instead of all possible modifiers) for the typing streak timeout setting described above, add the following line to your config.h and define a bit mask: only those modifiers that match this mask will be governed by the typing streak timeout. For example, to exempt Shift modifiers from the typing streak timeout while still targeting all other modifiers, you can specify the following mask.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              #define BILATERAL_COMBINATIONS_TYPING_STREAK_MODMASK (~MOD_MASK_SHIFT)
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Porting to ZMK

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              I switched to a new keyboard powered by ZMK +firmware recently and I feared it might take another 6 months to rewrite my QMK-based solution +described thus far. Fortunately, I was able to port an essential subset of my +QMK patches without having to modify ZMK source at all: I didn’t need to write +a single line of C++!

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              By declaratively defining “custom behaviors” in ZMK, I was able to configure +home row mods disambiguation using a combination of these behavioral components:

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              • flavor="tap-preferred" for strictly time-based home row mods activation
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • flavor="balanced" for short-circuiting sequence-based layer activation
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • hold-trigger for cross-hand home row mods enforcement (positional hold-tap)
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • tapping-term-ms for home row mods detection, as governed by flavor setting
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • quick-tap-ms for automatic key repetition via “tap then hold” usage pattern
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • require-prior-idle-ms timeout for typing streak enforcement
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              The resulting ZMK configuration is posted here, with documentation in comments. +It has separate custom behaviors per hand for crossover bilateral combinations; +as well as per thumbs, index fingers, and the rest for differences in dexterity.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              compatible = "zmk,behavior-hold-tap";
                                                                                                                                                                                                                                                                                                                                                              +flavor = HOMEY_HOLDING_TYPE;
                                                                                                                                                                                                                                                                                                                                                              +hold-trigger-key-positions = <OPPOSITE_HAND_KEYS THUMB_KEYS>;
                                                                                                                                                                                                                                                                                                                                                              +hold-trigger-on-release; // wait for other home row mods
                                                                                                                                                                                                                                                                                                                                                              +tapping-term-ms = <HOMEY_HOLDING_TIME>;
                                                                                                                                                                                                                                                                                                                                                              +quick-tap-ms = <HOMEY_REPEAT_DECAY>;
                                                                                                                                                                                                                                                                                                                                                              +require-prior-idle-ms = <HOMEY_STREAK_DECAY>;
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              //
                                                                                                                                                                                                                                                                                                                                                              +// HOMEY_HOLDING_TYPE defines the flavor of ZMK hold-tap behavior to use
                                                                                                                                                                                                                                                                                                                                                              +// for the pinky, ring, and middle fingers (which are assigned to Super,
                                                                                                                                                                                                                                                                                                                                                              +// Alt, and Ctrl respectively in the Miryoku system) on home row keys.
                                                                                                                                                                                                                                                                                                                                                              +//
                                                                                                                                                                                                                                                                                                                                                              +#ifndef HOMEY_HOLDING_TYPE
                                                                                                                                                                                                                                                                                                                                                              +#define HOMEY_HOLDING_TYPE "tap-preferred"
                                                                                                                                                                                                                                                                                                                                                              +#endif
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +//
                                                                                                                                                                                                                                                                                                                                                              +// HOMEY_HOLDING_TIME defines how long you need to hold (milliseconds)
                                                                                                                                                                                                                                                                                                                                                              +// home row mod keys in order to send their modifiers to the computer
                                                                                                                                                                                                                                                                                                                                                              +// (i.e. "register" them) for mod-click mouse usage (e.g. Ctrl-Click).
                                                                                                                                                                                                                                                                                                                                                              +//
                                                                                                                                                                                                                                                                                                                                                              +#ifndef HOMEY_HOLDING_TIME
                                                                                                                                                                                                                                                                                                                                                              +#define HOMEY_HOLDING_TIME 270 // TAPPING_TERM + ALLOW_CROSSOVER_AFTER
                                                                                                                                                                                                                                                                                                                                                              +#endif
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +//
                                                                                                                                                                                                                                                                                                                                                              +// HOMEY_STREAK_DECAY defines how long you need to wait (milliseconds)
                                                                                                                                                                                                                                                                                                                                                              +// after typing before you can use home row mods again.  It prevents
                                                                                                                                                                                                                                                                                                                                                              +// unintended activation of home row mods when you're actively typing.
                                                                                                                                                                                                                                                                                                                                                              +//
                                                                                                                                                                                                                                                                                                                                                              +#ifndef HOMEY_STREAK_DECAY
                                                                                                                                                                                                                                                                                                                                                              +#define HOMEY_STREAK_DECAY 230
                                                                                                                                                                                                                                                                                                                                                              +#endif
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +//
                                                                                                                                                                                                                                                                                                                                                              +// HOMEY_REPEAT_DECAY defines how much time you have left (milliseconds)
                                                                                                                                                                                                                                                                                                                                                              +// after tapping a key to hold it again in order to make it auto-repeat.
                                                                                                                                                                                                                                                                                                                                                              +//
                                                                                                                                                                                                                                                                                                                                                              +#ifndef HOMEY_REPEAT_DECAY
                                                                                                                                                                                                                                                                                                                                                              +#define HOMEY_REPEAT_DECAY 300 // "tap then hold" for key auto-repeat
                                                                                                                                                                                                                                                                                                                                                              +#endif
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              To illustrate, here is a table of varying behaviors per hand and finger as +arranged in Miryoku’s “G-A-C-S” order on the Engram keyboard layout’s home row.

                                                                                                                                                                                                                                                                                                                                                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                              Left PinkyLeft RingLeft MiddleLeft Index(Finger)Right IndexRight MiddleRight RingRight Pinky
                                                                                                                                                                                                                                                                                                                                                              LGUILALTLCTRLLSHFT(Hold)LSHFTLCTRLLALTLGUI
                                                                                                                                                                                                                                                                                                                                                              CIEA(Tap)HTSN
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Specifically, since index fingers are the most dexterous, the normal rules don’t apply to them well. They roll, tap, and hold rapidly and quite differently based on your typing rhythm and use-case. So the “balanced” flavor of hold-tap in ZMK wasn’t the best choice for them as I sometimes roll with my index fingers, which ends up triggering mods when I don’t intend to. Moreover, the “balanced” flavor’s requirement to release the modified (shifted in my case since I use shift on index fingers) key breaks my rhythm and speed when typing CamelCase variable names: I want it to trigger the mod instantly in this case. Instead, the strictly time-based “tap-preferred” flavor seems to better encapsulate their inconsistent complexity (sometimes I want tap, other times I want hold). And that’s essentially what my QMK implementation does, effectively reading my mind.

                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Bilateral combinations enforcement

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              💁 Refer to my keymap in the Glove80 Layout Editor for implementation.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              The way I’ve implemented bilateral combinations is with 2 levels of hold-taps +bridged by a layer transition. The first level starts at the base layer, with +the first home row mod that you hold taking you its respective layer on the +second level. For example, holding the LeftIndex key takes you to the LeftIndex +layer, which masks all same-sided keys with either (1) additional hold-taps for +the remaining home row mods or (2) mod-cancelling taps for other remaining keys.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Effectively, this approach constructs a “sandwich” 🥪 of timing thresholds:

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              1. You hold the first modifier for at least HOMEY_HOLDING_TIME milliseconds.

                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                • The first modifier is now “registered” (sent to the computer).
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • You are sent to the first modifier’s corresponding layer in the keymap.
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                              3. You hold the second modifier for at least CHORD_HOLDING_TIME milliseconds.

                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                • The second modifier is now “registered” (sent to the computer).
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                              5. You can repeat step 2 to add even more modifiers to your multi-mod chord.

                                                                                                                                                                                                                                                                                                                                                              6. +
                                                                                                                                                                                                                                                                                                                                                              7. You tap a key on the opposite hand.

                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                • The tap is now “registered” (sent to the computer) and it’s nested under +the modifiers you’re already holding (which have also already been +“registered”).
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                              8. +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              NOTE: If you don’t hold the second modifier long enough at step #2, it will +look like a same-sided tap, which will then trigger the bilateral combinations +logic:

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              • The first modifier will be released.
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • The first modifier’s normal keycode will be tapped.
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • The second modifier’s normal keycode will be tapped.
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                              Snippet

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              See contents of the keymap.dtsi file in my Glove80 keymaps repository on GitHub.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Updates


                                                                                                                                                                                                                                                                                                                                                              Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                              Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/hterm-shift-pageup.html b/hterm-shift-pageup.html new file mode 100644 index 0000000..cc5dcc8 --- /dev/null +++ b/hterm-shift-pageup.html @@ -0,0 +1,66 @@ +Enabling shifted page keys in hterm - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                              Enabling shifted page keys in hterm

                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                              hterm binds Shift+PageUp/Down keys for scrolling its own backbuffer by default. +To override those defaults and allow the underlying terminal session to receive +those keys, while also adding support for Alt and Control modifier keys, simply:

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              1. open the nassh extension’s options page
                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                              3. open Chrome Developer Tools (Ctrl+Shift+I)
                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                              5. paste the following snippet in the console:
                                                                                                                                                                                                                                                                                                                                                              6. +
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              term_.prefs_.set("keybindings", {
                                                                                                                                                                                                                                                                                                                                                              +  "Shift-PGUP":          "'\u001b[5;2~'",
                                                                                                                                                                                                                                                                                                                                                              +  "Shift-PGDN":          "'\u001b[6;2~'",
                                                                                                                                                                                                                                                                                                                                                              +  "Alt-Shift-PGUP":      "'\u001b[5;4~'",
                                                                                                                                                                                                                                                                                                                                                              +  "Alt-Shift-PGDN":      "'\u001b[6;4~'",
                                                                                                                                                                                                                                                                                                                                                              +  "Ctrl-Shift-PGUP":     "'\u001b[5;6~'",
                                                                                                                                                                                                                                                                                                                                                              +  "Ctrl-Shift-PGDN":     "'\u001b[6;6~'",
                                                                                                                                                                                                                                                                                                                                                              +  "Ctrl-Alt-Shift-PGUP": "'\u001b[5;8~'",
                                                                                                                                                                                                                                                                                                                                                              +  "Ctrl-Alt-Shift-PGDN": "'\u001b[6;8~'"
                                                                                                                                                                                                                                                                                                                                                              +});
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              For example, I commonly use Shift+PageUp as a convenient shortcut to enter tmux’s +copy mode and then immediately scroll up by one page (tmux copy-mode -u):

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              bind-key -n S-PPage copy-mode -u
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              But how could I possibly have known those esoteric keycodes in the first place? +:-) It was only possible with the help of arcane knowledge in this MinTTY wiki, which +explained the notation of special editing keys and how they are +modified:

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              modifier keys Shift, Alt and Ctrl are … encoded as a one-digit number that becomes part of the keycode. To obtain that number, add the numbers for each pressed modifier to 1: +Shift=1, +Alt=2, +Ctrl=4.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                              Keyplainmodified
                                                                                                                                                                                                                                                                                                                                                              PgUp^[[5~^[[5;m~
                                                                                                                                                                                                                                                                                                                                                              PgDn^[[6~^[[6;m~
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Using that formula, I calculated the one-digit numbers for my modifier combos:

                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              • Shift: (1) + 1 = 2
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • Alt+Shift: (2 + 1) + 1 = 4
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • Ctrl+Shift: (4 + 1) + 1 = 6
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • Ctrl+Alt+Shift: (4 + 2 + 1) + 1 = 8
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              With these results, I was able to override the hterm keybindings setting above.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/iex-eval-stdin.html b/iex-eval-stdin.html new file mode 100644 index 0000000..0561c6b --- /dev/null +++ b/iex-eval-stdin.html @@ -0,0 +1,118 @@ +Automating interactive Elixir evaluation via stdin - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                              Automating interactive Elixir evaluation via stdin

                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                              1. Problem
                                                                                                                                                                                                                                                                                                                                                                1. Approach
                                                                                                                                                                                                                                                                                                                                                                  1. Solution
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Problem

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Newcomers to the Elixir language begin their +official instruction using the iex tool, +which places the user in Elixir’s interactive mode. +Inside this mode, all of the Elixir commands the user types in are short-lived, +disappearing entirely (or only partially, if history is enabled) when the user quits the +iex session.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    $ iex
                                                                                                                                                                                                                                                                                                                                                                    +Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +Interactive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)
                                                                                                                                                                                                                                                                                                                                                                    +iex(1)> 40 + 2
                                                                                                                                                                                                                                                                                                                                                                    +42
                                                                                                                                                                                                                                                                                                                                                                    +iex(2)> "hello" <> " world"
                                                                                                                                                                                                                                                                                                                                                                    +"hello world"
                                                                                                                                                                                                                                                                                                                                                                    +iex(3)> ^C
                                                                                                                                                                                                                                                                                                                                                                    +BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
                                                                                                                                                                                                                                                                                                                                                                    +       (v)ersion (k)ill (D)b-tables (d)istribution
                                                                                                                                                                                                                                                                                                                                                                    +a
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    To avoid repeating the manual labor of retyping all of their Elixir commands (or +reinserting them from saved history) when starting a new iex +session, the clever user naturally attempts to store all of their Elixir commands +in a file and to then run that file with iex. This way, each line in the file +would be treated as if the user had manually typed it all in. :-) Problem +solved, right?

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    $ cat commands.txt
                                                                                                                                                                                                                                                                                                                                                                    +40 + 2
                                                                                                                                                                                                                                                                                                                                                                    +"hello" <> " world"
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    $ iex < commands.txt
                                                                                                                                                                                                                                                                                                                                                                    +Interactive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)
                                                                                                                                                                                                                                                                                                                                                                    +iex(1)> 42
                                                                                                                                                                                                                                                                                                                                                                    +iex(2)> "hello world"
                                                                                                                                                                                                                                                                                                                                                                    +iex(3)> ^C
                                                                                                                                                                                                                                                                                                                                                                    +BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
                                                                                                                                                                                                                                                                                                                                                                    +       (v)ersion (k)ill (D)b-tables (d)istribution
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Alas, iex merely prints the results of the clever user’s Elixir commands. :-( +Whereas this whole method of interaction would be far more useful if iex had +also printed each of the user’s Elixir commands along with their result, right?

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    $ iex-eval-stdin < commands.txt
                                                                                                                                                                                                                                                                                                                                                                    +Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +Interactive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)
                                                                                                                                                                                                                                                                                                                                                                    +iex(1)> 40 + 2
                                                                                                                                                                                                                                                                                                                                                                    +42
                                                                                                                                                                                                                                                                                                                                                                    +iex(2)> "hello" <> " world"
                                                                                                                                                                                                                                                                                                                                                                    +"hello world"
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    That would make it easier to learn Elixir, if both cause and effect were shown.

                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                    Approach

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Since iex is an interactive tool, it naturally expects to talk to the user’s +terminal device instead of the plain-text standard input and output streams. +For example, syntax highlighting the user’s Elixir command results only makes +sense when iex is talking to a terminal device; not to the plain-text stdout.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Thus, I needed to create a fake terminal device for iex to talk to, through +which I would send each of the user’s Elixir commands, read from stdin, to iex. +Luckily, the Expect tool allows us to perform +exactly this kind of automation.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    To start off, I wrote a Bourne shell function that generates an Expect script +from the contents of the user’s file (provided on stdin), taking care to escape +each line of input so that Expect would pass them through as-is to iex:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    iex_eval_stdin() {
                                                                                                                                                                                                                                                                                                                                                                    +  {
                                                                                                                                                                                                                                                                                                                                                                    +    echo spawn iex "$@"
                                                                                                                                                                                                                                                                                                                                                                    +    echo 'expect "iex(*)> "'
                                                                                                                                                                                                                                                                                                                                                                    +    while read -r line; do
                                                                                                                                                                                                                                                                                                                                                                    +      echo "$line" | sed 's/["$\[\\]/\\&/g; s/^/send -- "/; s/$/\\r"/'
                                                                                                                                                                                                                                                                                                                                                                    +      echo 'expect "???(*)> "'
                                                                                                                                                                                                                                                                                                                                                                    +    done
                                                                                                                                                                                                                                                                                                                                                                    +  } | expect -
                                                                                                                                                                                                                                                                                                                                                                    +  echo -n -e '\033[2K\r' # clear the very last prompt
                                                                                                                                                                                                                                                                                                                                                                    +}
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Once this prototype was working, I translated it into Expect to avoid escaping.

                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                    Solution

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Below is my solution iex-eval-stdin script, which is also available on +GitHub.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    #!/usr/bin/expect -f
                                                                                                                                                                                                                                                                                                                                                                    +#
                                                                                                                                                                                                                                                                                                                                                                    +# Usage: iex-eval-stdin -- [ARGUMENTS_FOR_IEX...]
                                                                                                                                                                                                                                                                                                                                                                    +# Usage: iex-eval-stdin < YOUR_ELIXIR_SCRIPT_FILE
                                                                                                                                                                                                                                                                                                                                                                    +# Usage: echo YOUR_ELIXIR_SCRIPT | iex-eval-stdin
                                                                                                                                                                                                                                                                                                                                                                    +#
                                                                                                                                                                                                                                                                                                                                                                    +# Runs each line from the standard input stream using iex(1), as if
                                                                                                                                                                                                                                                                                                                                                                    +# each line were interactively typed into iex(1) in the first place.
                                                                                                                                                                                                                                                                                                                                                                    +#
                                                                                                                                                                                                                                                                                                                                                                    +# Written in 2018 by Suraj N. Kurapati <https://github.com/sunaku>
                                                                                                                                                                                                                                                                                                                                                                    +# and documented at <https://sunaku.github.io/iex-eval-stdin.html>
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +set prompt {\n(iex|\.\.\.)(\(\d+\)|\(.+@.+\)\d+)> $}
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +eval spawn -noecho iex $argv
                                                                                                                                                                                                                                                                                                                                                                    +while {[gets stdin line] >= 0} {
                                                                                                                                                                                                                                                                                                                                                                    +  expect -re $prompt
                                                                                                                                                                                                                                                                                                                                                                    +  send -- "$line\r"
                                                                                                                                                                                                                                                                                                                                                                    +}
                                                                                                                                                                                                                                                                                                                                                                    +expect -re $prompt ;# await last result
                                                                                                                                                                                                                                                                                                                                                                    +puts "\033\[1K"    ;# clear last prompt
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    To install this script, copy/paste it into a file or download it from GitHub. +Then, mark it as executable so that you can run it just by typing in its name:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    $ chmod +x ./iex-eval-stdin
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Now, you can run it: (if you don’t like typing the ./, move it into your $PATH)

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    $ echo '2 = 1 + 1' | ./iex-eval-stdin
                                                                                                                                                                                                                                                                                                                                                                    +Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +Interactive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)
                                                                                                                                                                                                                                                                                                                                                                    +iex(1)> 2 = 1 + 1
                                                                                                                                                                                                                                                                                                                                                                    +2
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +$ ./iex-eval-stdin < THE_FILESYSTEM_PATH_OF_YOUR_OWN_ELIXIR_SCRIPT_GOES_HERE
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    If you get an error saying that Expect couldn’t be found, try installing it:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    $ sudo apt-get install expect
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    That’s all. :-) Enjoy learning Elixir!

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/index.atom b/index.atom new file mode 100644 index 0000000..2d01f74 --- /dev/null +++ b/index.atom @@ -0,0 +1,300 @@ +https://sunaku.github.io/The Terminal Programmer +This image is the "Linux Zealot" icon from the "Forum Faces 2" icon set by Cian Walsh of Afterglow Design (www.afterglow.ie) +

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I program, incessantly,
                                                                                                                                                                                                                                                                                                                                                                    +and I fear it will be the end of me.
                                                                                                                                                                                                                                                                                                                                                                    +I cannot stop, for it commands my will,
                                                                                                                                                                                                                                                                                                                                                                    +thus I am the terminal programmer, nil.

                                                                                                                                                                                                                                                                                                                                                                    +]]>
                                                                                                                                                                                                                                                                                                                                                                    2024-02-04T23:34:44-08:00Suraj N. Kurapatihttps://sunaku.github.io/engram-keyboard-layout.htmlSwitching to Arno's Engram 2.0 keyboard layout2024-02-04T23:34:44-08:002021-05-07T06:45:13ZSuraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                    Added new sections on Learning and Adaptation.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Added Z/Q and B/V variations to address pinky finger load and reachability.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Added a new Comparison section with my feedback posted online about Engram.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    ]]>
                                                                                                                                                                                                                                                                                                                                                                    https://sunaku.github.io/home-row-mods.htmlTaming home row mods with bilateral combinations2024-01-01T18:47:17-08:002022-10-16T05:06:31-07:00Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                    I’ve finally implemented bilateral combinations in +ZMK! ❤️‍🔥 It’s still a hair shy 🧐 +(lacking multi-key chord unrolling during unilateral cancellation) compared to +my QMK endgame patch, but that’s such a theoretical corner case that I don’t +think anyone would actually notice in practice. 🙃 Enjoy!

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    In my ZMK port:

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Allow the user to override all #defines at the very top of the “Custom +Defined Behaviors” ZMK snippet, by guarding each #define with #ifdef.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    In my ZMK port, I’ve incorporated the new require-prior-idle-ms feature that +was recently merged into ZMK to produce the crispest, most responsive typing +I’ve ever experienced outside of the typing layer! 🫰🤯✨ ZMK docs say this can +eliminate input lag when typing quickly, and they’re right! 💯

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Additionally, what this gives us in terms of configuration is the separation of +streak vs. repeat decay timers — specifically for homey mods and index finger +shifts, but potentially also for thumbs and any other hold-taps imaginable! ️ Thanks to Bryan Forbes for the use-case behind this.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I’ve released version 25 of my ZMK snippet with improved spacebar handling.

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Thumb keys: disable retro-tap for all thumb keys except spacebar. The backspace thumb key for cursor layer was accidentally navigating the browser back in history for me sometimes.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Thumb keys: increase hold time to 200ms for non-space thumb keys to avoid layer activation where they map you into &none.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Thumb keys: increase repeat decay time to 300ms for non-space thumb keys so it’s easier to hold backspace for repetition.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Rename INDEX_* settings to SHIFT_* because it’s semantically shift: it needs to be fast regardless of the finger it’s on (not just the indexes). Also rename &thumb_space to &space for same reason.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I was able to enable typing streaks for index finger shifts while still +maintaining fast activation for CamelCase typing. 😤 Next, I separated +index fingers’ typing streak from the other home row mods and fine-tuned +the timing per my taste: apparently, 70ms is my magic number… 🪄 it +just boosted me to my highest raw speed ever (115) measured with home +row mods enabled! 🤩 The typefeel is also very crisp 🫰 now, and I +must say that I’m quite pleased with this. 👌 See updated ZMK snippet +in the Porting to ZMK section.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Still not completely satisfied by the robustness of home row mods +disambiguation in my ZMK port, I’ve switched back from the “balanced” +flavor of hold-tap to the purely time-based “tap-preferred” flavor in +order to be more in line with my endgame QMK patch… and oh my, am I +impressed! 😍

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    This change has significantly improved typing responsiveness (less delay +from keystroke to letter showing up on the computer screen) and also +increased my confidence in the home row mods disambiguation system. +😎👌 I mean, typing is fun now — it’s unexpectedly satisfying to +see letters appear instantly on the screen when I press a key. 👏 +Hooray for latency! ✨

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I have added a ZMK port of my QMK patches for home row mods disambiguation.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Inspired by ZMK’s global-quick-tap feature, I’ve +implemented a typing streak timeout setting that suppresses home row mods +while actively typing.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    #define BILATERAL_COMBINATIONS_TYPING_STREAK_TIMEOUT 160  /* ms */
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    However, this obstructs the Shift modifier when typing parentheses or +punctuation marks such as ! and ? at the end of a sentence; and it requires +a dedicated Shift key as a workaround, per @urob’s “timeless” mods for +ZMK. So I went on to +exempt Shift modifiers from typing streaks using a bitmask:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    #define BILATERAL_COMBINATIONS_TYPING_STREAK_MODMASK (~MOD_MASK_SHIFT)
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    With all this, typing feels natural again! No more unconscious fears +about accidentally triggering home row mods. 😌 It’s a complete game changer! 🤩

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I have fixed some corner cases, simplified the configuration, improved chording support, and upgraded to QMK 0.19.10. Eager mods are now enabled by default (so that mod-clicks Just Work out of the box) but you can delay them via #define settings.

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Removed CHORDSIZE setting since it’s now hard-coded to the maximum allowed value in QMK.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Removed EAGERMODS setting since “eager mods” are now always enabled by default.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Renamed EAGERMASK setting to DELAY_MODS_THAT_MATCH and thereby inverted its meaning (it now specifies modifiers that should be delayed, not made eager).
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Renamed DEFERMODS setting to DELAY_MATCHED_MODS_BY.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Renamed CROSSOVER setting to ALLOW_CROSSOVER_AFTER.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Renamed SAMESIDED setting to ALLOW_SAMESIDED_AFTER.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    For example, here is a diff showing how my personal configuration has changed since my last update to this article and associated set of patches:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    -#define BILATERAL_COMBINATIONS_EAGERMODS 1
                                                                                                                                                                                                                                                                                                                                                                    +-#define BILATERAL_COMBINATIONS_EAGERMASK (~MOD_MASK_GUI)
                                                                                                                                                                                                                                                                                                                                                                    +-#define BILATERAL_COMBINATIONS_DEFERMODS 100
                                                                                                                                                                                                                                                                                                                                                                    +-#define BILATERAL_COMBINATIONS_CROSSOVER 75
                                                                                                                                                                                                                                                                                                                                                                    +-#define BILATERAL_COMBINATIONS_SAMESIDED 3000
                                                                                                                                                                                                                                                                                                                                                                    +-#define BILATERAL_COMBINATIONS_CHORDSIZE 4 // one side GUI, Alt, Shift, Control
                                                                                                                                                                                                                                                                                                                                                                    ++#define BILATERAL_COMBINATIONS_DELAY_MODS_THAT_MATCH MOD_MASK_GUI
                                                                                                                                                                                                                                                                                                                                                                    ++#define BILATERAL_COMBINATIONS_DELAY_MATCHED_MODS_BY 100
                                                                                                                                                                                                                                                                                                                                                                    ++#define BILATERAL_COMBINATIONS_ALLOW_CROSSOVER_AFTER 75
                                                                                                                                                                                                                                                                                                                                                                    ++#define BILATERAL_COMBINATIONS_ALLOW_SAMESIDED_AFTER 3000
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I have added support for chord tapping (multiple mod keys) and “eager mods” for +mod-click mouse usage. The overall logic is illustrated visually as a +flowchart and the various #define settings are now +documented here as well.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    This is, by far, the crispest typing experience I’ve felt in years! :)

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I have replaced the FLASHMODS mask definition with a +new DEFERMODS timeout in order to implement Miryoku’s +suggestion of (1) suppressing all modifiers as “flashing mods” and +(2) registering them later, after a timeout, for mod-click mouse usage.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    -#define BILATERAL_COMBINATIONS_FLASHMODS MOD_MASK_GUI
                                                                                                                                                                                                                                                                                                                                                                    ++#define BILATERAL_COMBINATIONS_DEFERMODS 100
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    ]]>
                                                                                                                                                                                                                                                                                                                                                                    https://sunaku.github.io/moergo-glove80-keyboard.htmlMoErgo Glove80 programmable ergonomic keyboard2023-12-01T18:12:00-08:002023-07-04T05:00:41-07:00Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                    I’ve published a video tour of my symbol layer, with examples in Vim:

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Click to watch video

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I’ve released version 31 featuring mouse keys (keyboard control of mouse pointer & wheel), Unicode curly quotes, and improved Number layer affinity.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I’ve released version 30 featuring an improved symbol layer with balanced triangles and support for spacegrams; and support for QWERTY and a few other popular keyboard layouts (which you can activate dynamically via Magic+N or set as the base layer when compiling your keymap) in order to welcome other layout users on the path to a glorious typing experience. 🖖

                                                                                                                                                                                                                                                                                                                                                                    +symbol layer

                                                                                                                                                                                                                                                                                                                                                                    I’ve released version 29 featuring +an improved symbol layer (as follows), and I’ve added an +explanation of the design methodology I appear to follow. +Also, I’ve added interactive usage examples to most of the layer diagrams.

                                                                                                                                                                                                                                                                                                                                                                    +cursor layer changes

                                                                                                                                                                                                                                                                                                                                                                    I released version 25 featuring Emoji, international characters, and more!

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Added Emoji layer and World layer, activated by thumbs’ satellite keys.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Symbol layer: swap backtick and double quotes so that I can inward roll from equals to double quote in one swoop. + +
                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                      • (" for starting a string value argument for a function call.
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                      • =" for HTML attributes and Bourne shell variable assignments.
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Cursor layer: easier one-handed SelectAll -> Cut/Copy/Paste; put undo/redo on same upper row as right hand; adjust find keys accordingly.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I’ve observed that I don’t really use , and ; from the bottom row in +practice for navigating Vim’s f/F/t/T jumps, so I’ve been thinking about +a better use for them. Having comma and dot paired together on a single +hand (like their relative positioning in QWERTY) might be useful for +shortcuts that assume their adjacency — for instance, I have Alt+, +and Alt+. navigate to the prev/next window in tmux. And apostrophe +has been missing from the symbol layer because it’s readily accessible +from the base layer, but it may be nice to add it anyway for +completeness. Hence this design iteration:

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Symbol layer: put apostrophe, comma, dot (like the Dvorak layout) on +bottom row. The comma and dot align with the angle brackets above them. +The apostrophe is just there for completeness; and '<,'> ranges in Vim.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    A minor semantic tweak to the symbol layer (backslash on ESC key) and some documentation about index finger home row mods (as inward-rolling chords):

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Symbol layer: swap backslash and percentage to place backslash on the same key as ESC. Percentage acts as the “matchit” operator in Vim.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Custom Defined Behaviors: add a CAUTION note about the inward-rolling requirement for index fingers, which disable hold-trigger-on-release:
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    CAUTION: You’ll need to perform inward rolls from pinky->ring->middle +fingers toward the index fingers when activating multiple modifiers +because hold-trigger-on-release is disabled for the index fingers. +Otherwise, you may be surprised that the index fingers’ modifier is +sent immediately without the rest of your multi-mod chord when you +perform outward rolls from your index fingers toward your pinkies.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Improved the gaming layer and right-handed mousing on the cursor layer. Also +added lower, gaming, and +typing layers to the interactive layer map.

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Gaming layer: Move ZXCV to bottom-most row; add BNM on the top row of home block; put ESC/Enter/Win on thumb cluster; restore tilde above tab; move Pause to furthest key in lower arc of thumb cluster.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Cursor layer: Move left half’s undo/redo keys to J/K position. Add word/line selection macros and find/next/prev/replace keys on left half for right-handed mouse usage. Also remove the ScrollLock shortcut from the Cursor layer (it’s still available on the left thumb cluster of the System layer). Thanks to @luminous_echidna for the suggestions.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Better right-handed mouse usage, easier Vim line/column jumping, and more:

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Miryoku: Move ring finger AltGr modifiers to upper row to avoid accidental triggers since I tend to hold X/F down longer than necessary when curling my ring fingers compared to when I extend them out to reach Y/W on the upper row.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Base layer: Swap = and \ so that = alternates with space bar on right thumb when typing = assignments.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Cursor layer: Move insert to rightmost bottom key and replace with backspace above left arrow on home row.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Cursor layer: Mirror cut/copy/paste and undo/redo keys on left hand for right-handed mouse usage. Thanks to @n0rvegan for this great idea!
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Cursor layer: Surround find prev/next keys with find and find/replace.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Symbol layer: Wrap parentheses () with square brackets [] and replace innermost , position with ;. This splits the (); sequence apart but still maintains it as an inward roll. This also establishes Vim’s ,; order for f/F/t/T jump repetition.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Number layer: Replace <>= in rightmost column with kjG for jumping to line numbers in Vim.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • Number layer: Add | on the rightmost bottom corner key for jumping to column numbers in Vim.
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Added instructions for horizontal mirroring in the Glove80 Layout Editor.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    ]]>
                                                                                                                                                                                                                                                                                                                                                                    https://sunaku.github.io/tmux-yank-osc52.htmlCopying to clipboard from tmux and Vim using OSC 522023-07-04T15:37:55-07:002014-04-19T13:04:46-07:00Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                    Updated the tmux configuration snippet to enable allow-passthrough for tmux 3.3 +and newer. Thanks to Jonathan Wheeler for suggesting this solution, which I had +previously implemented in August 2022 but missed updating here.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Verify the $DISPLAY environment variable before attempting xsel and xclip.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Pipe the text to be copied into tmux load-buffer instead of passing it as an +argument to tmux set-buffer, thereby avoiding any shell (mis)interpretation. +Thanks to Jonathan Wheeler for reporting this issue.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Restored X11 support in the yank script because its removal didn’t prevent +the entire terminal screen to be copied to tmux clipboard when using Vim.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Removed X11 support from the yank script because running it from within Vim +caused the entire terminal screen to be copied to tmux clipboard. Also, removed +the workaround of clearing the KiTTY terminal clipboard before yanking; use the +clipboard_control no-append setting in ~/.config/kitty/kitty.conf instead:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    clipboard_control write-clipboard write-primary no-append
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Larry Sanderson contributed this Vim configuration snippet that automates +yanking to system clipboard by calling the yank(1) script in this article:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    " Set it up so all yanks copy to system clipboard
                                                                                                                                                                                                                                                                                                                                                                    +function! CopyYank() abort
                                                                                                                                                                                                                                                                                                                                                                    +  call Yank(join(v:event.regcontents, "\n"))
                                                                                                                                                                                                                                                                                                                                                                    +endfunction
                                                                                                                                                                                                                                                                                                                                                                    +autocmd TextYankPost * call CopyYank()
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Fixed tmux detection under nested SSH. Added support for KiTTY terminal.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    When you start an SSH session from inside tmux, the $TMUX environment +variable does not carry forward into that newly started SSH session. As a +result, when you run the yank script inside that SSH session, it doesn’t +realize that it’s actually attached to a tmux client (since $TMUX is not set) +and it therefore doesn’t specially wrap the OSC 52 sequence for tmux. +As a result, tmux discards the bare OSC 52 sequence and it all falls apart.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    To solve this, we instead look to the $TERM environment variable, which +begins with the word “screen” for all terminal sessions started under tmux.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Vim snippet now handles /bin/sh: /dev/tty: No such device or address errors +on some systems by using writefile() instead of shell redirection. It also +provides a convenient Yank() function to abstract away the yank system call.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Updated configuration snippet for tmux 2.4, using send-keys -X copy-pipe.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Gary Bishop discovered that the Vim mapping +presented in this article needed to explicitly redirect the OSC 52 escape +sequence generated by the yank(1) script to the terminal device in order to +work correctly in certain environments (Linux => tmux => ssh => Chromebook):

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    :call system('yank > /dev/tty', @0)
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    See the comments thread at the bottom of this article for more information.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Updated yank(1) script. Added M-Y and y copy-pipe shortcuts for tmux.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I have updated the yank(1) script in this article to copy its input text +into tmux’s clipboard in addition to the operating system clipboard.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    ]]>
                                                                                                                                                                                                                                                                                                                                                                    https://sunaku.github.io/ergohaven-remnant-keyboard.htmlErgohaven Remnant programmable ergonomic keyboard2023-01-28T23:57:21-08:002023-01-28T23:57:21-08:00Suraj N. Kurapatihttps://sunaku.github.io/dactyl-manuform-5x6-keyboard.htmlDactyl Manuform 5x6 programmable ergonomic keyboard2022-10-23T03:29:39-07:002022-10-23T03:29:39-07:00Suraj N. Kurapatihttps://sunaku.github.io/engrammer-keyboard-layout.htmlEngrammer - Arno's Engram layout for programmers2022-08-28T09:50:40Z2022-08-28T09:50:40ZSuraj N. Kurapatihttps://sunaku.github.io/tmux-select-pane.htmlIntelligently navigating tmux panes and Vim splits2020-04-25T22:03:25-07:002015-05-05T17:43:38-07:00Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                    I’ve published the code in this article as an installable tmux/Vim plugin:

                                                                                                                                                                                                                                                                                                                                                                    + + +

                                                                                                                                                                                                                                                                                                                                                                    Thanks to @bradleyharden for contributing a +working example of TPM plugin conversion and giving me the opportunity to host +this plugin in my GitHub.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Erase stray ESC + hjkl keys for panes that are misidentified as containing Vim. +This occurs when holding down the shortcut keys or using an old Vim that leaves +behind a dirty window title labeled “Thanks for flying Vim!”.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Use the #{q:} shell quoting directive in tmux-2.9a when interpolating tmux +variables to properly support pane titles that contain quotation marks.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    When Vim is launched from within git commit as the editor for a git commit +message, the value of #{pane_current_command} is git instead of vim.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Use -b option for run-shell instead of the & shell background operator:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    bind-key -n M-h run-shell -b "$navigate_left"
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-j run-shell -b "$navigate_down"
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-k run-shell -b "$navigate_up"
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-l run-shell -b "$navigate_right"
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-\ run-shell -b "$navigate_back"
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Fixed a corner case of NeoVim not clearing title quickly enough upon exit.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Renamed M-; to M-\ to fix a tmux configuration error in QWERTY shortcuts:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    .tmux.conf: usage: bind-key [-cnr] [-T key-table] key command [arguments]
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Simpler shortcut definitions and faster execution by running in background:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    bind-key -n M-h run-shell "$navigate_left  &"
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-j run-shell "$navigate_down  &"
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-k run-shell "$navigate_up    &"
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-l run-shell "$navigate_right &"
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-\ run-shell "$navigate_back  &"
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Added support for seamless navigation of embedded NeoVim terminal sessions.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I’ve rolled my own replacement for the vim-tmux-navigator plugin: the tmux +keybindings presented in this article now handle Vim navigation without the +need for any special Vim plugins (or configuration thereof). It Just Works!

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    To illustrate, here is how the code used to appear before this update:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    " in ~/.vimrc
                                                                                                                                                                                                                                                                                                                                                                    +nnoremap <silent> <A-h> :TmuxNavigateLeft<Return>
                                                                                                                                                                                                                                                                                                                                                                    +nnoremap <silent> <A-j> :TmuxNavigateDown<Return>
                                                                                                                                                                                                                                                                                                                                                                    +nnoremap <silent> <A-k> :TmuxNavigateUp<Return>
                                                                                                                                                                                                                                                                                                                                                                    +nnoremap <silent> <A-l> :TmuxNavigateRight<Return>
                                                                                                                                                                                                                                                                                                                                                                    +nnoremap <silent> <A-;> :TmuxNavigatePrevious<Return>
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    # in ~/.tmux.conf
                                                                                                                                                                                                                                                                                                                                                                    +bind-key -n M-h run-shell '                                  \
                                                                                                                                                                                                                                                                                                                                                                    +  case "#{pane_current_command}" in (*vim*) inside=1;; esac; \
                                                                                                                                                                                                                                                                                                                                                                    +  case "${inside:-0}#{window_zoomed_flag}" in                \
                                                                                                                                                                                                                                                                                                                                                                    +  (00) tmux select-pane -L                          ;;       \
                                                                                                                                                                                                                                                                                                                                                                    +  (10) tmux send-keys M-h                           ;;       \
                                                                                                                                                                                                                                                                                                                                                                    +  (11) tmux send-keys C-w h                         ;;       \
                                                                                                                                                                                                                                                                                                                                                                    +  esac                                                       \
                                                                                                                                                                                                                                                                                                                                                                    +'
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Improved the specificity of the glob pattern for detecting Vim’s presence.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Replaced the positional argument arithmetic with case statements. The code +still uses binary encoding but it’s more compact and easier to read now. :)

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    To illustrate, here is how the code appeared before this change:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    bind-key -n M-h run-shell                                     ' \
                                                                                                                                                                                                                                                                                                                                                                    +  test #{window_zoomed_flag} -eq 0; max=$?;                     \
                                                                                                                                                                                                                                                                                                                                                                    +  cmd="#{pane_current_command}"; test -n "${cmd#*vim}"; vim=$?; \
                                                                                                                                                                                                                                                                                                                                                                    +  set --                                                        \
                                                                                                                                                                                                                                                                                                                                                                    +    "tmux select-pane -L"                                       \
                                                                                                                                                                                                                                                                                                                                                                    +    ""                                                          \
                                                                                                                                                                                                                                                                                                                                                                    +    "tmux send-keys M-h"                                        \
                                                                                                                                                                                                                                                                                                                                                                    +    "tmux send-keys C-w h";                                     \
                                                                                                                                                                                                                                                                                                                                                                    +  shift $(( 2*vim + max ));                                     \
                                                                                                                                                                                                                                                                                                                                                                    +  eval "$1";                                                    \
                                                                                                                                                                                                                                                                                                                                                                    +'
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    In contrast, here is how the code appears now, after the change:

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    bind-key -n M-h run-shell                              ' \
                                                                                                                                                                                                                                                                                                                                                                    +  case "#{pane_current_command}" in (*vi*) vim=1;; esac; \
                                                                                                                                                                                                                                                                                                                                                                    +  case "${vim:-0}#{window_zoomed_flag}" in               \
                                                                                                                                                                                                                                                                                                                                                                    +  (00) tmux select-pane -L                            ;; \
                                                                                                                                                                                                                                                                                                                                                                    +  (10) tmux send-keys M-h                             ;; \
                                                                                                                                                                                                                                                                                                                                                                    +  (11) tmux send-keys C-w h                           ;; \
                                                                                                                                                                                                                                                                                                                                                                    +  esac                                                   \
                                                                                                                                                                                                                                                                                                                                                                    +'
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I’ll need to update the explanation section accordingly, someday!

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    ]]>
                                                                                                                                                                                                                                                                                                                                                                    https://sunaku.github.io/gruvbox-terminal-color-scheme.htmlGruvbox terminal color scheme2018-12-20T19:17:07-08:002016-03-03T16:37:00-08:00Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                    Changed blacks to grays because they were unreadable against background.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    ]]>
                                                                                                                                                                                                                                                                                                                                                                    https://sunaku.github.io/elixir-fileio-speedup.htmlSpeeding up I/O on very large files in Elixir2018-12-18T20:40:41-08:002017-03-07T16:35:00-08:00Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                    This article has been superseded by Elixir’s +Flow and GenStage libraries:

                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Click to watch video

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    ]]>
                                                                                                                                                                                                                                                                                                                                                                    https://sunaku.github.io/iex-eval-stdin.htmlAutomating interactive Elixir evaluation via stdin2018-10-28T17:33:46-07:002018-10-28T17:33:46-07:00Suraj N. Kurapati
                                                                                                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..4dcce23 --- /dev/null +++ b/index.html @@ -0,0 +1,10 @@ +The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                    The Terminal Programmer RSS

                                                                                                                                                                                                                                                                                                                                                                    Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                    +This image is the "Linux Zealot" icon from the "Forum Faces 2" icon set by Cian Walsh of Afterglow Design (www.afterglow.ie) +

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    I program, incessantly,
                                                                                                                                                                                                                                                                                                                                                                    +and I fear it will be the end of me.
                                                                                                                                                                                                                                                                                                                                                                    +I cannot stop, for it commands my will,
                                                                                                                                                                                                                                                                                                                                                                    +thus I am the terminal programmer, nil.

                                                                                                                                                                                                                                                                                                                                                                    +



                                                                                                                                                                                                                                                                                                                                                                    Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                    Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..e02b0ff --- /dev/null +++ b/index.js @@ -0,0 +1,70 @@ +$(function() { + // create links to preceding and following entries in navigation chain + var chain_by_entry_id = {"engram-keyboard-layout":{"following":{"url":"home-row-mods.html","title":"Taming home row mods with bilateral combinations"}},"home-row-mods":{"preceding":{"url":"engram-keyboard-layout.html","title":"Switching to Arno's Engram 2.0 keyboard layout"},"following":{"url":"moergo-glove80-keyboard.html","title":"MoErgo Glove80 programmable ergonomic keyboard"}},"moergo-glove80-keyboard":{"preceding":{"url":"home-row-mods.html","title":"Taming home row mods with bilateral combinations"},"following":{"url":"tmux-yank-osc52.html","title":"Copying to clipboard from tmux and Vim using OSC 52"}},"tmux-yank-osc52":{"preceding":{"url":"moergo-glove80-keyboard.html","title":"MoErgo Glove80 programmable ergonomic keyboard"},"following":{"url":"ergohaven-remnant-keyboard.html","title":"Ergohaven Remnant programmable ergonomic keyboard"}},"ergohaven-remnant-keyboard":{"preceding":{"url":"tmux-yank-osc52.html","title":"Copying to clipboard from tmux and Vim using OSC 52"},"following":{"url":"dactyl-manuform-5x6-keyboard.html","title":"Dactyl Manuform 5x6 programmable ergonomic keyboard"}},"dactyl-manuform-5x6-keyboard":{"preceding":{"url":"ergohaven-remnant-keyboard.html","title":"Ergohaven Remnant programmable ergonomic keyboard"},"following":{"url":"engrammer-keyboard-layout.html","title":"Engrammer - Arno's Engram layout for programmers"}},"engrammer-keyboard-layout":{"preceding":{"url":"dactyl-manuform-5x6-keyboard.html","title":"Dactyl Manuform 5x6 programmable ergonomic keyboard"},"following":{"url":"tmux-select-pane.html","title":"Intelligently navigating tmux panes and Vim splits"}},"tmux-select-pane":{"preceding":{"url":"engrammer-keyboard-layout.html","title":"Engrammer - Arno's Engram layout for programmers"},"following":{"url":"gruvbox-terminal-color-scheme.html","title":"Gruvbox terminal color scheme"}},"gruvbox-terminal-color-scheme":{"preceding":{"url":"tmux-select-pane.html","title":"Intelligently navigating tmux panes and Vim splits"},"following":{"url":"elixir-fileio-speedup.html","title":"Speeding up I/O on very large files in Elixir"}},"elixir-fileio-speedup":{"preceding":{"url":"gruvbox-terminal-color-scheme.html","title":"Gruvbox terminal color scheme"},"following":{"url":"iex-eval-stdin.html","title":"Automating interactive Elixir evaluation via stdin"}},"iex-eval-stdin":{"preceding":{"url":"elixir-fileio-speedup.html","title":"Speeding up I/O on very large files in Elixir"},"following":{"url":"vegan-for-life.html","title":"Vegan: Healthy, Sustainable, Compassionate Living"}},"vegan-for-life":{"preceding":{"url":"iex-eval-stdin.html","title":"Automating interactive Elixir evaluation via stdin"},"following":{"url":"hterm-shift-pageup.html","title":"Enabling shifted page keys in hterm"}},"hterm-shift-pageup":{"preceding":{"url":"vegan-for-life.html","title":"Vegan: Healthy, Sustainable, Compassionate Living"},"following":{"url":"papercolor-terminal-color-scheme.html","title":"PaperColor terminal color scheme"}},"papercolor-terminal-color-scheme":{"preceding":{"url":"hterm-shift-pageup.html","title":"Enabling shifted page keys in hterm"},"following":{"url":"meditation-five-steps.html","title":"Meditation in five steps"}},"meditation-five-steps":{"preceding":{"url":"papercolor-terminal-color-scheme.html","title":"PaperColor terminal color scheme"},"following":{"url":"zabutom-zeta-force-level-2.html","title":"zabutom's Zeta Force Level 2, rearranged"}},"zabutom-zeta-force-level-2":{"preceding":{"url":"meditation-five-steps.html","title":"Meditation in five steps"},"following":{"url":"elixir-parallel-grep.html","title":"A parallel grep(1) prototype in Elixir"}},"elixir-parallel-grep":{"preceding":{"url":"zabutom-zeta-force-level-2.html","title":"zabutom's Zeta Force Level 2, rearranged"},"following":{"url":"git-rebase-autocon.html","title":"Automatic merge conflict resolution for git-rebase(1)"}},"git-rebase-autocon":{"preceding":{"url":"elixir-parallel-grep.html","title":"A parallel grep(1) prototype in Elixir"},"following":{"url":"tmux-layout-dwindle.html","title":"Porting dwm's dwindle layout to tmux"}},"tmux-layout-dwindle":{"preceding":{"url":"git-rebase-autocon.html","title":"Automatic merge conflict resolution for git-rebase(1)"},"following":{"url":"tmux-24bit-color.html","title":"Adding 24-bit TrueColor RGB escape sequences to tmux"}},"tmux-24bit-color":{"preceding":{"url":"tmux-layout-dwindle.html","title":"Porting dwm's dwindle layout to tmux"},"following":{"url":"startx-login-tty1.html","title":"Automatically starting X after logging into a Linux virtual terminal"}},"startx-login-tty1":{"preceding":{"url":"tmux-24bit-color.html","title":"Adding 24-bit TrueColor RGB escape sequences to tmux"},"following":{"url":"4digit-base36-timestamp.html","title":"Encoding four base 36 digits as a timestamp"}},"4digit-base36-timestamp":{"preceding":{"url":"startx-login-tty1.html","title":"Automatically starting X after logging into a Linux virtual terminal"},"following":{"url":"xfce-enlarge-titlebar-buttons.html","title":"Enlarging titlebar buttons in XFCE"}},"xfce-enlarge-titlebar-buttons":{"preceding":{"url":"4digit-base36-timestamp.html","title":"Encoding four base 36 digits as a timestamp"},"following":{"url":"acer-c720-linux.html","title":"Lubuntu 14.10 on the Acer C720 Chromebook"}},"acer-c720-linux":{"preceding":{"url":"xfce-enlarge-titlebar-buttons.html","title":"Enlarging titlebar buttons in XFCE"},"following":{"url":"minitest-colordiff.html","title":"Colorful assertion failure diffs in MiniTest"}},"minitest-colordiff":{"preceding":{"url":"acer-c720-linux.html","title":"Lubuntu 14.10 on the Acer C720 Chromebook"},"following":{"url":"tomorrow-terminal-color-scheme.html","title":"Tomorrow terminal color scheme"}},"tomorrow-terminal-color-scheme":{"preceding":{"url":"minitest-colordiff.html","title":"Colorful assertion failure diffs in MiniTest"},"following":{"url":"tmux-refocus-patch.html","title":"Remembering window pane focus in tmux"}},"tmux-refocus-patch":{"preceding":{"url":"tomorrow-terminal-color-scheme.html","title":"Tomorrow terminal color scheme"},"following":{"url":"tmux-searchable-scrollback.html","title":"Searching the scrollback buffer in tmux"}},"tmux-searchable-scrollback":{"preceding":{"url":"tmux-refocus-patch.html","title":"Remembering window pane focus in tmux"},"following":{"url":"tmux-half-screen-tiling-layouts.html","title":"Half-screen tiling layouts in tmux"}},"tmux-half-screen-tiling-layouts":{"preceding":{"url":"tmux-searchable-scrollback.html","title":"Searching the scrollback buffer in tmux"},"following":{"url":"tamsyn-1.7b-font-review.html","title":"Tamsyn 1.7b programming font review"}},"tamsyn-1.7b-font-review":{"preceding":{"url":"tmux-half-screen-tiling-layouts.html","title":"Half-screen tiling layouts in tmux"},"following":{"url":"slim-tilt-redcarpet.html","title":"Using Redcarpet for Markdown in Slim"}},"slim-tilt-redcarpet":{"preceding":{"url":"tamsyn-1.7b-font-review.html","title":"Tamsyn 1.7b programming font review"},"following":{"url":"tmux-pane-zoom.html","title":"Temporarily zooming panes in tmux"}},"tmux-pane-zoom":{"preceding":{"url":"slim-tilt-redcarpet.html","title":"Using Redcarpet for Markdown in Slim"},"following":{"url":"rails3-gui-api.html","title":"Decoupling GUI from API in Ruby on Rails 3"}},"rails3-gui-api":{"preceding":{"url":"tmux-pane-zoom.html","title":"Temporarily zooming panes in tmux"},"following":{"url":"sencha-architect2-rails31-asset-pipeline.html","title":"Putting Sencha Architect 2 into Rails 3.1's asset pipeline"}},"sencha-architect2-rails31-asset-pipeline":{"preceding":{"url":"rails3-gui-api.html","title":"Decoupling GUI from API in Ruby on Rails 3"},"following":{"url":"vim-256color-bce.html","title":"Fixing Vim's Background Color Erase for 256-color tmux and GNU screen"}},"vim-256color-bce":{"preceding":{"url":"sencha-architect2-rails31-asset-pipeline.html","title":"Putting Sencha Architect 2 into Rails 3.1's asset pipeline"},"following":{"url":"4-reminders-6-paramitas-1-universe.html","title":"Four reminders, Six paramitas, and One universe"}},"4-reminders-6-paramitas-1-universe":{"preceding":{"url":"vim-256color-bce.html","title":"Fixing Vim's Background Color Erase for 256-color tmux and GNU screen"},"following":{"url":"extracting-archives-without-making-a-mess.html","title":"Extracting archives without making a mess"}},"extracting-archives-without-making-a-mess":{"preceding":{"url":"4-reminders-6-paramitas-1-universe.html","title":"Four reminders, Six paramitas, and One universe"},"following":{"url":"extjs4-mvc-rails31-asset-pipeline.html","title":"Putting ExtJS 4 into Rails 3.1's asset pipeline"}},"extjs4-mvc-rails31-asset-pipeline":{"preceding":{"url":"extracting-archives-without-making-a-mess.html","title":"Extracting archives without making a mess"},"following":{"url":"test-loop.html","title":"Continuous testing for Ruby with fork/eval"}},"test-loop":{"preceding":{"url":"extjs4-mvc-rails31-asset-pipeline.html","title":"Putting ExtJS 4 into Rails 3.1's asset pipeline"},"following":{"url":"dwm-spawn-cwd-patch.html","title":"Spawn from current working directory in DWM"}},"dwm-spawn-cwd-patch":{"preceding":{"url":"test-loop.html","title":"Continuous testing for Ruby with fork/eval"},"following":{"url":"vim-script-management-system.html","title":"Vim script management system"}},"vim-script-management-system":{"preceding":{"url":"dwm-spawn-cwd-patch.html","title":"Spawn from current working directory in DWM"},"following":{"url":"zenburn-terminal-color-scheme.html","title":"Zenburn terminal color scheme"}},"zenburn-terminal-color-scheme":{"preceding":{"url":"vim-script-management-system.html","title":"Vim script management system"},"following":{"url":"oniguruma-negated-regexps.html","title":"Negated regular expressions in Oniguruma and Ruby"}},"oniguruma-negated-regexps":{"preceding":{"url":"zenburn-terminal-color-scheme.html","title":"Zenburn terminal color scheme"},"following":{"url":"ruby-1.9.3-p0-power-efficiency.html","title":"Ruby 1.9.3 power efficiency ends wmiirc woes"}},"ruby-1.9.3-p0-power-efficiency":{"preceding":{"url":"oniguruma-negated-regexps.html","title":"Negated regular expressions in Oniguruma and Ruby"},"following":{"url":"switching-from-fish-to-zsh.html","title":"Switching from Fish to ZSH"}},"switching-from-fish-to-zsh":{"preceding":{"url":"ruby-1.9.3-p0-power-efficiency.html","title":"Ruby 1.9.3 power efficiency ends wmiirc woes"},"following":{"url":"xoria256-terminal-color-scheme.html","title":"xoria256 terminal color scheme"}},"xoria256-terminal-color-scheme":{"preceding":{"url":"switching-from-fish-to-zsh.html","title":"Switching from Fish to ZSH"},"following":{"url":"yaml-json-validation-kwalify-ruby19.html","title":"Validating machine-generated YAML and JSON using Kwalify in Ruby 1.9"}},"yaml-json-validation-kwalify-ruby19":{"preceding":{"url":"xoria256-terminal-color-scheme.html","title":"xoria256 terminal color scheme"},"following":{"url":"contest-rails-testing-monkeypatch.html","title":"Using Contest's context() in Rails' controller tests"}},"contest-rails-testing-monkeypatch":{"preceding":{"url":"yaml-json-validation-kwalify-ruby19.html","title":"Validating machine-generated YAML and JSON using Kwalify in Ruby 1.9"},"following":{"url":"xoria256-menu-color-patch.html","title":"xoria256 menu color patch"}},"xoria256-menu-color-patch":{"preceding":{"url":"contest-rails-testing-monkeypatch.html","title":"Using Contest's context() in Rails' controller tests"},"following":{"url":"joe-hisaishi-sheeta-no-ketsui.html","title":"Transcription of Joe Hisaishi's \"Sheeta no Ketsui\""}},"joe-hisaishi-sheeta-no-ketsui":{"preceding":{"url":"xoria256-menu-color-patch.html","title":"xoria256 menu color patch"},"following":{"url":"ryuichi-sakamoto-solitude.html","title":"Transcription of Ryuichi Sakamoto's \"Solitude\""}},"ryuichi-sakamoto-solitude":{"preceding":{"url":"joe-hisaishi-sheeta-no-ketsui.html","title":"Transcription of Joe Hisaishi's \"Sheeta no Ketsui\""},"following":{"url":"guiltless-monkeypatching-with-uuid.html","title":"Guiltless monkeypatching with UUID"}},"guiltless-monkeypatching-with-uuid":{"preceding":{"url":"ryuichi-sakamoto-solitude.html","title":"Transcription of Ryuichi Sakamoto's \"Solitude\""},"following":{"url":"wmii-3.1-ruby-config.html","title":"wmii-3.1 configuration in Ruby"}},"wmii-3.1-ruby-config":{"preceding":{"url":"guiltless-monkeypatching-with-uuid.html","title":"Guiltless monkeypatching with UUID"},"following":{"url":"jedit-max-width-patch.html","title":"Truly elastic word-wrapping in jEdit"}},"jedit-max-width-patch":{"preceding":{"url":"wmii-3.1-ruby-config.html","title":"wmii-3.1 configuration in Ruby"},"following":{"url":"telugu-rts-with-scim.html","title":"Telugu RTS with SCIM"}},"telugu-rts-with-scim":{"preceding":{"url":"jedit-max-width-patch.html","title":"Truly elastic word-wrapping in jEdit"},"following":{"url":"defining-methods-for-erb-templates.html","title":"Defining methods for ERB templates"}},"defining-methods-for-erb-templates":{"preceding":{"url":"telugu-rts-with-scim.html","title":"Telugu RTS with SCIM"},"following":{"url":"switching-from-jedit-to-vim.html","title":"Switching from jEdit to Vim"}},"switching-from-jedit-to-vim":{"preceding":{"url":"defining-methods-for-erb-templates.html","title":"Defining methods for ERB templates"},"following":{"url":"copyleft-mit-license.html","title":"Copyleft variation of the MIT license"}},"copyleft-mit-license":{"preceding":{"url":"switching-from-jedit-to-vim.html","title":"Switching from jEdit to Vim"},"following":{"url":"nanase-hikaru-honoka-na-omoi.html","title":"Transcription of Nanase Hikaru's \"Honoka na Omoi\""}},"nanase-hikaru-honoka-na-omoi":{"preceding":{"url":"copyleft-mit-license.html","title":"Copyleft variation of the MIT license"},"following":{"url":"darcs-2-enhances-amend-record.html","title":"Darcs 2 enhances amend-record"}},"darcs-2-enhances-amend-record":{"preceding":{"url":"nanase-hikaru-honoka-na-omoi.html","title":"Transcription of Nanase Hikaru's \"Honoka na Omoi\""},"following":{"url":"openag5-typing-microcontroller-pins.html","title":"Tying wires to microcontroller pins"}},"openag5-typing-microcontroller-pins":{"preceding":{"url":"darcs-2-enhances-amend-record.html","title":"Darcs 2 enhances amend-record"},"following":{"url":"ruby-vpi-c-extension-breakthrough.html","title":"Breakthrough in Ruby-VPI's C extension and Ruby 1.9 support"}},"ruby-vpi-c-extension-breakthrough":{"preceding":{"url":"openag5-typing-microcontroller-pins.html","title":"Tying wires to microcontroller pins"},"following":{"url":"chess-diagrams-in-lyx-with-pdflatex.html","title":"Chess diagrams in LyX with PDFLaTeX"}},"chess-diagrams-in-lyx-with-pdflatex":{"preceding":{"url":"ruby-vpi-c-extension-breakthrough.html","title":"Breakthrough in Ruby-VPI's C extension and Ruby 1.9 support"},"following":{"url":"masters-thesis-completed.html","title":"Masters Thesis completed"}},"masters-thesis-completed":{"preceding":{"url":"chess-diagrams-in-lyx-with-pdflatex.html","title":"Chess diagrams in LyX with PDFLaTeX"},"following":{"url":"using-telugu-in-ubuntu-linux.html","title":"How to use Telugu in Ubuntu Linux"}},"using-telugu-in-ubuntu-linux":{"preceding":{"url":"masters-thesis-completed.html","title":"Masters Thesis completed"},"following":{"url":"ruby-vpi-using-ruby-debug.html","title":"Using ruby-debug with ruby-vpi"}},"ruby-vpi-using-ruby-debug":{"preceding":{"url":"using-telugu-in-ubuntu-linux.html","title":"How to use Telugu in Ubuntu Linux"},"following":{"url":"one-tab-is-two-spaces.html","title":"One tab is two spaces"}},"one-tab-is-two-spaces":{"preceding":{"url":"ruby-vpi-using-ruby-debug.html","title":"Using ruby-debug with ruby-vpi"},"following":{"url":"darcs-migration-tailor-ascii-error.html","title":"ASCII/Unicode error in Tailor"}},"darcs-migration-tailor-ascii-error":{"preceding":{"url":"one-tab-is-two-spaces.html","title":"One tab is two spaces"},"following":{"url":"making-erb-behave-like-php.html","title":"Making ERB behave like PHP"}},"making-erb-behave-like-php":{"preceding":{"url":"darcs-migration-tailor-ascii-error.html","title":"ASCII/Unicode error in Tailor"},"following":{"url":"text-formatting-with-smart-crown-margins.html","title":"Text formatting with smart crown margins"}},"text-formatting-with-smart-crown-margins":{"preceding":{"url":"making-erb-behave-like-php.html","title":"Making ERB behave like PHP"},"following":{"url":"revival-of-the-ruby-vpi-project.html","title":"Revival of the ruby-vpi project"}},"revival-of-the-ruby-vpi-project":{"preceding":{"url":"text-formatting-with-smart-crown-margins.html","title":"Text formatting with smart crown margins"},"following":{"url":"compiling-jedit-in-ubuntu-linux.html","title":"Compiling jEdit under Ubuntu"}},"compiling-jedit-in-ubuntu-linux":{"preceding":{"url":"revival-of-the-ruby-vpi-project.html","title":"Revival of the ruby-vpi project"},"following":{"url":"organizing-firefox-bookmarks-with-freemind.html","title":"Organizing Firefox bookmarks with Freemind"}},"organizing-firefox-bookmarks-with-freemind":{"preceding":{"url":"compiling-jedit-in-ubuntu-linux.html","title":"Compiling jEdit under Ubuntu"},"following":{"url":"telugu-rts-with-scim-demo.html","title":"Video demonstration of Telugu RTS with SCIM"}},"telugu-rts-with-scim-demo":{"preceding":{"url":"organizing-firefox-bookmarks-with-freemind.html","title":"Organizing Firefox bookmarks with Freemind"},"following":{"url":"telugu-vocabulary.html","title":"Telugu vocabulary for modern Telugu people"}},"telugu-vocabulary":{"preceding":{"url":"telugu-rts-with-scim-demo.html","title":"Video demonstration of Telugu RTS with SCIM"},"following":{"url":"telugu-fonts-in-ubuntu-breezy.html","title":"Proper rendering of Indic fonts in Ubuntu Breezy"}},"telugu-fonts-in-ubuntu-breezy":{"preceding":{"url":"telugu-vocabulary.html","title":"Telugu vocabulary for modern Telugu people"},"following":{"url":"the-umbrella-of-sacrifice.html","title":"The umbrella of sacrifice"}},"the-umbrella-of-sacrifice":{"preceding":{"url":"telugu-fonts-in-ubuntu-breezy.html","title":"Proper rendering of Indic fonts in Ubuntu Breezy"},"following":{"url":"making-jedit-and-wmii-2-cooperate.html","title":"Making jEdit and WMII-2 cooperate"}},"making-jedit-and-wmii-2-cooperate":{"preceding":{"url":"the-umbrella-of-sacrifice.html","title":"The umbrella of sacrifice"},"following":{"url":"soundblaster-audigy-2-value-in-ubuntu-hoary.html","title":"SoundBlaster Audigy 2 Value and Ubuntu Hoary"}},"soundblaster-audigy-2-value-in-ubuntu-hoary":{"preceding":{"url":"making-jedit-and-wmii-2-cooperate.html","title":"Making jEdit and WMII-2 cooperate"},"following":{"url":"ftv01-la-jetee-effects.html","title":"On the effectiveness of La Jetée"}},"ftv01-la-jetee-effects":{"preceding":{"url":"soundblaster-audigy-2-value-in-ubuntu-hoary.html","title":"SoundBlaster Audigy 2 Value and Ubuntu Hoary"},"following":{"url":"ftv01-the-power-of-film.html","title":"The power of film"}},"ftv01-the-power-of-film":{"preceding":{"url":"ftv01-la-jetee-effects.html","title":"On the effectiveness of La Jetée"},"following":{"url":"compiling-workrave-in-fedora-core-4.html","title":"Compiling Workrave in Fedora Core 4"}},"compiling-workrave-in-fedora-core-4":{"preceding":{"url":"ftv01-the-power-of-film.html","title":"The power of film"},"following":{"url":"his29-essay2.html","title":"Vedic and Upanishadic influence in the Bhagavadh Giitha"}},"his29-essay2":{"preceding":{"url":"compiling-workrave-in-fedora-core-4.html","title":"Compiling Workrave in Fedora Core 4"},"following":{"url":"his29-essay1.html","title":"Major changes in South Asian rituals in 1500-500 BCE"}},"his29-essay1":{"preceding":{"url":"his29-essay2.html","title":"Vedic and Upanishadic influence in the Bhagavadh Giitha"},"following":{"url":"educ92a-essay.html","title":"Forced assimilation in American public education"}},"educ92a-essay":{"preceding":{"url":"his29-essay1.html","title":"Major changes in South Asian rituals in 1500-500 BCE"},"following":{"url":"telugu-rts-with-iiimf.html","title":"Telugu RTS with IIIMF"}},"telugu-rts-with-iiimf":{"preceding":{"url":"educ92a-essay.html","title":"Forced assimilation in American public education"},"following":{"url":"mac-address-rotation.html","title":"MAC address rotation"}},"mac-address-rotation":{"preceding":{"url":"telugu-rts-with-iiimf.html","title":"Telugu RTS with IIIMF"},"following":{"url":"socy15-essay3.html","title":"Changes in Womens' roles due to Industrialization in Northern Europe"}},"socy15-essay3":{"preceding":{"url":"mac-address-rotation.html","title":"MAC address rotation"},"following":{"url":"musc80v-midterm.html","title":"From \"A Hard Day's Night\" to \"Help!\": changes in The Beatles' music and personality"}},"musc80v-midterm":{"preceding":{"url":"socy15-essay3.html","title":"Changes in Womens' roles due to Industrialization in Northern Europe"},"following":{"url":"socy15-essay1.html","title":"What is Globalization?"}},"socy15-essay1":{"preceding":{"url":"musc80v-midterm.html","title":"From \"A Hard Day's Night\" to \"Help!\": changes in The Beatles' music and personality"},"following":{"url":"socy15-essay2.html","title":"Chinese World Domination in the 19th Century"}},"socy15-essay2":{"preceding":{"url":"socy15-essay1.html","title":"What is Globalization?"},"following":{"url":"the-sixth-sense.html","title":"Review of M. Night Shyamalan's film \"The Sixth Sense\""}},"the-sixth-sense":{"preceding":{"url":"socy15-essay2.html","title":"Chinese World Domination in the 19th Century"},"following":{"url":"ebola-virus.html","title":"Investigating the Ebola HF virus"}},"ebola-virus":{"preceding":{"url":"the-sixth-sense.html","title":"Review of M. Night Shyamalan's film \"The Sixth Sense\""}}}; + var entry_id = $('#body').data('entry-id'); + if (entry_id) { + var chain = chain_by_entry_id[entry_id]; + if (chain) { + // element to surround with navigation links + var $target = $('article > header .navigation > a.rootlink'); + + var preceding = chain.preceding; + $target.before($(''). + attr('class', 'prevlink'). + attr('href', preceding && preceding.url). + attr('title', preceding && preceding.title)); + + var following = chain.following; + $target.after($(''). + attr('class', 'nextlink'). + attr('href', following && following.url). + attr('title', following && following.title)); + } + } + + // make alternate texts on images appear as tooltip labels on mouse-over + $('img[alt]:not([title])').each(function() { + $(this).attr('title', $(this).attr('alt')); + }); + + // filter entries on index page based on user input in the search box + var $entries = $('nav.entries > ul > li'); + var $headings = $('nav.entries > h2'); + $('article > header > form.search > input[type=search]').on( + 'keyup change focus blur search', function(event) { + var input = event.target.value; + if (input.match(/\S/)) { + var words = input.replace(/^\s+|\s+$/g, '').split(/\s+/g); + var regexp = new RegExp(words.join('|'), 'ig'); + $headings.hide(); + $entries.each(function() { + var $entry = $(this); + if (regexp.test($entry.text())) { + $entry.show(); + $entry.parent('ul').prev('h2').show(); + } + else { + $entry.hide(); + } + }); + } + else { + $entries.show(); + $headings.show(); + } + } + ); + + // replace embedded YouTube video thumbnail links with '); + iframe.attr('src', hyperlink.attr('href')); + iframe.attr('width', thumbnail.width()); + iframe.attr('height', thumbnail.height()); + iframe.attr('frameborder', 0); + hyperlink.replaceWith(iframe); + return false; + }); +}); diff --git a/jedit-max-width-patch.html b/jedit-max-width-patch.html new file mode 100644 index 0000000..aa294c9 --- /dev/null +++ b/jedit-max-width-patch.html @@ -0,0 +1,77 @@ +Truly elastic word-wrapping in jEdit - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                    Truly elastic word-wrapping in jEdit

                                                                                                                                                                                                                                                                                                                                                                    Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                    1. Problem
                                                                                                                                                                                                                                                                                                                                                                      1. Approach
                                                                                                                                                                                                                                                                                                                                                                        1. Solution
                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Problem

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          jEdit’s soft word-wrap feature, when used with a wrap-margin of zero, +dynamically wraps text to fit the window. However, this feature isn’t very +useful on a wide-screen display because most lines of text are not wrapped +since they are not long enough to span the entire screen.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          In such cases, I would prefer having a finite wrap-margin to limit how long +lines need to be in order to be wrapped. However, when a finite wrap-margin is +used, the text does not elastically wrap to the window when the window is +thinner than the limit.

                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                          Approach

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Thus, I wanted the best of both worlds: a maximum width feature, like the +max-width property in CSS, which would:

                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                          1. elastically wrap text to the window’s width when it is thinner than the maximum width

                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                          3. wrap text to the maximum width when the window’s width is wider than the maximum width

                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          When I requested this feature on the jEdit users mailing list, the developers had mixed opinions about incorporating it. Nevertheless, +they helped me implement the feature in my own copy of the jEdit source +code.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          I posted the patch file for this feature to the mailing list soon after.

                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                          Solution

                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                          Index: org/gjt/sp/jedit/textarea/TextArea.java
                                                                                                                                                                                                                                                                                                                                                                          +===================================================================
                                                                                                                                                                                                                                                                                                                                                                          +--- org/gjt/sp/jedit/textarea/TextArea.java (revision 11614)
                                                                                                                                                                                                                                                                                                                                                                          ++++ org/gjt/sp/jedit/textarea/TextArea.java (working copy)
                                                                                                                                                                                                                                                                                                                                                                          +@@ -5775,6 +5775,41 @@
                                                                                                                                                                                                                                                                                                                                                                          +        {
                                                                                                                                                                                                                                                                                                                                                                          +                this.maxLineLen = maxLineLen;
                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                          ++       /**
                                                                                                                                                                                                                                                                                                                                                                          ++           Makes soft word-wrap mode behave like the CSS "max-width" property:
                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                          ++           1. When the window width is less than the maximum, the wrapping
                                                                                                                                                                                                                                                                                                                                                                          ++              behaves like wrap-margin is 0 (fits to the window).
                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                          ++           2. When the window width is greater than the maximum, the wrapping behaves
                                                                                                                                                                                                                                                                                                                                                                          ++              like fixed wrap-margin (wrapping restricted to the maximum width).
                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                          ++           @see discussion of this feature at:
                                                                                                                                                                                                                                                                                                                                                                          ++                http://sourceforge.net/mailarchive/forum.php?thread_id=31224167&forum_id=5663
                                                                                                                                                                                                                                                                                                                                                                          ++       */
                                                                                                                                                                                                                                                                                                                                                                          ++       if(softWrap)
                                                                                                                                                                                                                                                                                                                                                                          ++       {
                                                                                                                                                                                                                                                                                                                                                                          ++           // determine width of maximum rendered line
                                                                                                                                                                                                                                                                                                                                                                          ++           char[] foo = new char[maxLineLen];
                                                                                                                                                                                                                                                                                                                                                                          ++           for(int i = 0; i < foo.length; i++)
                                                                                                                                                                                                                                                                                                                                                                          ++           {
                                                                                                                                                                                                                                                                                                                                                                          ++               foo[i] = ' ';
                                                                                                                                                                                                                                                                                                                                                                          ++           }
                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                          ++           int maxRenderedLineLen = (int)painter.getFont().getStringBounds(
                                                                                                                                                                                                                                                                                                                                                                          ++               foo,0,foo.length,
                                                                                                                                                                                                                                                                                                                                                                          ++               painter.getFontRenderContext())
                                                                                                                                                                                                                                                                                                                                                                          ++               .getWidth();
                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                          ++           if(painter.getWidth() < maxRenderedLineLen)
                                                                                                                                                                                                                                                                                                                                                                          ++           {
                                                                                                                                                                                                                                                                                                                                                                          ++               wrapToWidth = true;
                                                                                                                                                                                                                                                                                                                                                                          ++               wrapMargin = painter.getWidth() - charWidth * 3;
                                                                                                                                                                                                                                                                                                                                                                          ++               return;
                                                                                                                                                                                                                                                                                                                                                                          ++           }
                                                                                                                                                                                                                                                                                                                                                                          ++       }
                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                          +                if(maxLineLen <= 0)
                                                                                                                                                                                                                                                                                                                                                                          +                {
                                                                                                                                                                                                                                                                                                                                                                          +                        if(softWrap)
                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Updates


                                                                                                                                                                                                                                                                                                                                                                          Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                          Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/joe-hisaishi-sheeta-no-ketsui.html b/joe-hisaishi-sheeta-no-ketsui.html new file mode 100644 index 0000000..095204b --- /dev/null +++ b/joe-hisaishi-sheeta-no-ketsui.html @@ -0,0 +1,21 @@ +Transcription of Joe Hisaishi's "Sheeta no Ketsui" - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                          Transcription of Joe Hisaishi's "Sheeta no Ketsui"

                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Here is my interpretation (based on my memory of Joe Hisaishi’s 2008 live +concert of Ghibli film soundtracks in the Budokan) of Joe Hisaishi’s song +Sheeta no Ketsui, which means “Sheeta’s decision”, from Studio +Ghibli’s animated film Laputa: Castle in the Sky.

                                                                                                                                                                                                                                                                                                                                                                          + + +

                                                                                                                                                                                                                                                                                                                                                                          I found the left-hand (bass clef) difficult to play because my hand is just +barely large enough to satisfy the enormous key span in some chord +progressions. Alas, if only I had three hands to play the Piano with! :-)

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Enjoy!

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/mac-address-rotation.html b/mac-address-rotation.html new file mode 100644 index 0000000..9bbc0a3 --- /dev/null +++ b/mac-address-rotation.html @@ -0,0 +1,37 @@ +MAC address rotation - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                          MAC address rotation

                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                          1. Problem
                                                                                                                                                                                                                                                                                                                                                                            1. Approach
                                                                                                                                                                                                                                                                                                                                                                              1. Solution

                                                                                                                                                                                                                                                                                                                                                                                MAC (Media Access Control) addresses are globally unique host (any network +entity capable of sending and receiving data) identifiers used at the Data- +Link layer of the OSI (Open Systems Interconnect) network model. By their very +nature, they provide a mechanism for implementing network access policies by +ISP (Internet Service Provider)s, such as allowing or restricting access to +any hosts of their choosing.

                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                Problem

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                Consider an ISP which denies network access to certain hosts by adding their +MAC addresses to a denied-list within the ISP’s DHCP (Dynamic Host +Configuration Protocol) server.

                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                Approach

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                Fortunately, a host whose MAC address is listed in the denied-list can emulate +a different MAC address and fool the ISP’s DHCP server and regain network +access.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                Note that MAC address emulation is a feasible alternative to the near +impossible task of altering the actual MAC address (which is hard-coded into +the SRAM (Static Random Access Memory) of NIC (Network Interface Controller)s +by manufacturers.

                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                Solution

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                There exist many software tools for emulating MAC addresses, including +ifconfig for GNU/Linux and SMAC for +Microsoft Windows.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                For ISPs who deny network access when, say, a bandwidth limit is exceeded, +hosts can maintain nearly constant (there is a short down-time during each +rotation) network access by scheduling changes or rotations in their +emulated MAC address. During rotations, a new MAC address can be assembled +using any valid 6-digit OUI (Organization Unique Identifier) +prefix followed by any 6-digit +hexadecimal number.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/making-erb-behave-like-php.html b/making-erb-behave-like-php.html new file mode 100644 index 0000000..40d6570 --- /dev/null +++ b/making-erb-behave-like-php.html @@ -0,0 +1,36 @@ +Making ERB behave like PHP - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                Making ERB behave like PHP

                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                I was surprised to find that ERB’s code embedding tags <% ... %> produce +a newline character by default. This was causing many formatting problems in +the generated output, so I hacked ERB to not +produce any output for its code embedding tags, just like PHP:

                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                require 'erb'
                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                +# A version of ERB whose embedding tags behave like those
                                                                                                                                                                                                                                                                                                                                                                                +# of PHP. That is, only <%= ... %> tags produce output,
                                                                                                                                                                                                                                                                                                                                                                                +# whereas <% ... %> tags do *not* produce any output.
                                                                                                                                                                                                                                                                                                                                                                                +class ERB
                                                                                                                                                                                                                                                                                                                                                                                +  alias original_initialize initialize
                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                +  def initialize aInput, *aArgs
                                                                                                                                                                                                                                                                                                                                                                                +    # ensure that only <%= ... %> tags generate output
                                                                                                                                                                                                                                                                                                                                                                                +      input = aInput.gsub %r{<%=.*?%>}m do |s|
                                                                                                                                                                                                                                                                                                                                                                                +        if ($' =~ /\r?\n/) == 0
                                                                                                                                                                                                                                                                                                                                                                                +          s << $&
                                                                                                                                                                                                                                                                                                                                                                                +        else
                                                                                                                                                                                                                                                                                                                                                                                +          s
                                                                                                                                                                                                                                                                                                                                                                                +        end
                                                                                                                                                                                                                                                                                                                                                                                +      end
                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                +      aArgs[1] = '>'
                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                +    original_initialize input, *aArgs
                                                                                                                                                                                                                                                                                                                                                                                +  end
                                                                                                                                                                                                                                                                                                                                                                                +end
                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                The hack involves setting ERB’s tag trimming mode to ">", which supresses +the generation of a newline character after a tag’s closing delimiter, and +appending an extra newline to ERB’s value embedding tags <%= ... %> which +happen to be at the end of a line.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/making-jedit-and-wmii-2-cooperate.html b/making-jedit-and-wmii-2-cooperate.html new file mode 100644 index 0000000..31d5b24 --- /dev/null +++ b/making-jedit-and-wmii-2-cooperate.html @@ -0,0 +1,21 @@ +Making jEdit and WMII-2 cooperate - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                Making jEdit and WMII-2 cooperate

                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                I’ve always had trouble using jEdit under the old wmi-1 +window manager because its “Search and Replace” +dialog, which I use frequently, wouldn’t function properly. In particular, the +dialog would only appear on the screen for the first two times it was invoked; +after that, you would have to detach and attach the dialog to make it visible.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                Under the new wmii-2 window manager, the problem +became worse. The dialog would not appear even when you detached and attached +it. However, to my surprise, having jEdit manage its own window borders solved +the problem!

                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                1. Launch jEdit.
                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                3. Open the “Global options” dialog.
                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                5. Choose the “Appearance” section.
                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                7. Enable the “Draw dialog box borders using Swing look & feel” option.
                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/masters-thesis-completed.html b/masters-thesis-completed.html new file mode 100644 index 0000000..c75e870 --- /dev/null +++ b/masters-thesis-completed.html @@ -0,0 +1,9 @@ +Masters Thesis completed - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                Masters Thesis completed

                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                I finally finished my Masters Thesis this morning and submitted it this +afternoon. It is available in both HTML and +PDF formats. It was written using LyX +and its diagrams were created using Dia.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/meditation-five-steps.html b/meditation-five-steps.html new file mode 100644 index 0000000..1678d28 --- /dev/null +++ b/meditation-five-steps.html @@ -0,0 +1,96 @@ +Meditation in five steps - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                Meditation in five steps

                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                1. Step 1. Bring body to seat
                                                                                                                                                                                                                                                                                                                                                                                  1. Step 2. Bring mind to body
                                                                                                                                                                                                                                                                                                                                                                                    1. Option 2. Follow your breathing
                                                                                                                                                                                                                                                                                                                                                                                      1. Option 2. Feel your breathing
                                                                                                                                                                                                                                                                                                                                                                                        1. Option 2. Feel your hands
                                                                                                                                                                                                                                                                                                                                                                                        2. Step 3. Refocus when lost
                                                                                                                                                                                                                                                                                                                                                                                          1. Step 4. Come back gently
                                                                                                                                                                                                                                                                                                                                                                                            1. Step 5. Hold this feeling

                                                                                                                                                                                                                                                                                                                                                                                              Here are five simple (but not easy: that only comes with practice ;) steps to +training in meditation, distilled from my meditation teacher at my workplace and also +from Buddhist monks whose lectures have rescued me in the darkest of times:

                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Click to watch video +What is meditation?

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Click to watch video +Meditation for economic development.

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Click to watch video +Child asks “How do I let my anger out?”

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Click to watch video +Does Meditation Affect Cellular Aging? — +Dr. Dean Ornish showed that his plant-based diet, exercise, and stress management intervention could in effect reverse the aging of our DNA. What effect might the stress management component have had?

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Click to watch video +How to Strengthen the Mind-Body Connection — +Slow-paced breathing at the right frequency can result in a vagal nerve activation, which may have a variety of beneficial effects.

                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                              Step 1. Bring body to seat

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Bring the body to a seat. Sit comfortably. When starting, use a +pillow/cushion or sit with your back against the wall if you need to.

                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                              Step 2. Bring mind to body

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Bring the mind to the body. The goal is to bring your awareness to +the present moment, here and now. Some techniques to achieve this are +as follows (try all of them initially, one per each sitting, until you +find what works for you; different people find different ones easier):

                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                              Option 2. Follow your breathing

                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                              • When you breathe in, say to yourself “I am breathing in”.
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • When you breathe out, say to yourself “I am breathing out”.
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • When you breathe in, follow your in-breath all the way through.
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • When you breathe out, follow your out-breath all the way through.
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              But make sure that your breathing is natural: don’t control it! +Let your body breathe naturally however it wants because your +goal is only to observe/notice/be aware of the present moment. +If it breathes slow and deep, let it. Fast and shallow, let it. +Pauses breathing sometimes, let it. Sharply inhales, let it. :)

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              And “following your breath” means to be aware of it through time: +notice how it feels as it begins, rises, peaks, falls, and stops?

                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                              Option 2. Feel your breathing

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Notice the physical sensation on the skin inside your nostrils as +you breathe in (cooler air) and breathe out (warmer air). You can also +notice your belly rise and fall as you breathe in and out, like a wave.

                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                              Option 2. Feel your hands

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              With your palms open and facing up, what can you physically feel +in the palms of your hands that prove to you that your hands exist? +For example, it may be the warmth in your palms, or the air in the room +circulating over your palms (mixing with warmth), or the pulse in your +fingertips, or the feeling of blood rushing through veins in your hands.

                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                              Step 3. Refocus when lost

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              When your thoughts and feelings take your focus away (and they will—even +for the greatest Zen masters! The goal isn’t to have 100% perfect +focus but instead to build resilience: to bring the mind back to focus) +simply notice that your mind has wandered and then bring it back to the +physical sensation. This is the actual training of meditation practice.

                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                              Step 4. Come back gently

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              When you are ready to stop meditating (when your timer bell rings):

                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                              1. Stay in meditation. Do not abruptly stop and continue with life.

                                                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                                                              3. Gently move your fingers and toes, as if you don’t want anybody to +notice that you are moving them, and sit up to straighten your posture.

                                                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                                                              5. Slowly open your eyes and then gaze at the floor in front of you. +Now, stay here with the feeling of meditation (peaceful, calm, still) +even though your eyes are open. If you lost the feeling as soon as +your eyes were opened, that’s okay, don’t panic: keep your eyes open +and refocus your mind on the physical sensation you were focusing on.

                                                                                                                                                                                                                                                                                                                                                                                              6. +
                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                              Step 5. Hold this feeling

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Take one final deep breath, in and out. You just did meditation! :)

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Notice how you feel now (peaceful, calm, still) in both body and mind. +This is the “feeling of meditation”, which you must hold onto / carry +with you now through the rest of the day. Just like a muscle becomes +stronger and can lift heavier weight as one trains in weight lifting, +so does the mind become more adept and proficient at bringing up that +feeling of meditation whenever you need it (it’s experiential wisdom).

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              You can do it! Good luck and have fun. ^_^

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/minitest-colordiff.html b/minitest-colordiff.html new file mode 100644 index 0000000..9977d80 --- /dev/null +++ b/minitest-colordiff.html @@ -0,0 +1,149 @@ +Colorful assertion failure diffs in MiniTest - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                              Colorful assertion failure diffs in MiniTest

                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                              A colorful MiniTest diff, after patching. +

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                1. Approach
                                                                                                                                                                                                                                                                                                                                                                                                  1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                    1. ~/bin/gdiff
                                                                                                                                                                                                                                                                                                                                                                                                      1. Ruby on Rails integration

                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                    Problem

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    After a long day of practicing test driven development in Ruby, I grew +weary of mentally parsing the colorless diffs that MiniTest displays when +assert_equal fails:

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    A typical MiniTest diff, before patching. +

                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                    Approach

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    I dove into the MiniTest codebase using ack, +hoping to find some way to pipe its diff output into +colordiff during display, and +discovered that MiniTest already shells out to diff(1) to produce its diff +output.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    In fact, MiniTest tries several different flavors of diff(1) before falling back to the standard one. One of these flavors is the +mysterious gdiff, which neither exists on my Arch Linux system nor is +available in its package repositories. That’s the ticket!

                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                    Solution

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    I quickly masqueraded colordiff as gdiff within my user account:

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    ln -s `which colordiff` ~/bin/gdiff
                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    re-ran my failing test, and saw colored diffs in the failure report!

                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                    ~/bin/gdiff

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Three years later, in the summer of 2014, I wrote my own gdiff script in +Ruby to further enhance the readability of MiniTest’s assert_equal diffs +by intelligently combining two complementary approaches of visualizing +intra-line differences into a single format:

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    A colorful MiniTest diff, after patching. +

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    There are several things happening in the screenshot above:

                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                    1. The changes are first visualized as a line-wise diff using the +diff-highlight script (if available) that comes bundled with Git itself.

                                                                                                                                                                                                                                                                                                                                                                                                    2. +
                                                                                                                                                                                                                                                                                                                                                                                                    3. A redundant hunk header (in this case: @@ -1 +1 @@) is displayed in reverse video to indicate +where the first visualization ends and where the second begins.

                                                                                                                                                                                                                                                                                                                                                                                                    4. +
                                                                                                                                                                                                                                                                                                                                                                                                    5. The changes are visualized again as a character-wise diff by +squashing common portions of changed lines using Git’s native +--word-diff-regex algorithm +unless the hunk being visualized only consists of whitespace changes.

                                                                                                                                                                                                                                                                                                                                                                                                    6. +
                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    As you can see, the second visualization complements the first by showing +you the character-wise differences within the line-wise differences! This +combination provides a more meaningful difference visualization overall.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    In addition, this gdiff(1) script goes beyond standard diff(1) to:

                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                    • color-code file headers according to difference highlighting colors
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • provide human-friendly descriptions of MiniTest value assertions
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • use blue instead of green for users who indicate that they are +colorblind by setting the $COLORBLIND environment variable
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Finally, here is the source code of my gdiff(1) script, also available on +GitHub, ready for +use. Simply download it into your ~/bin directory and happy diffing! :)

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    #!/usr/bin/env ruby
                                                                                                                                                                                                                                                                                                                                                                                                    +#
                                                                                                                                                                                                                                                                                                                                                                                                    +# MiniTest runs this command to show the differences between expected and
                                                                                                                                                                                                                                                                                                                                                                                                    +# actual values in assert_equal(), so we make it word-aware and colorful.
                                                                                                                                                                                                                                                                                                                                                                                                    +#
                                                                                                                                                                                                                                                                                                                                                                                                    +# You can make this script use blue instead of green by setting the COLORBLIND
                                                                                                                                                                                                                                                                                                                                                                                                    +# environment variable, as described at https://pypi.python.org/pypi/fragments
                                                                                                                                                                                                                                                                                                                                                                                                    +#
                                                                                                                                                                                                                                                                                                                                                                                                    +# See http://sunaku.github.io/minitest-colordiff.html for more information.
                                                                                                                                                                                                                                                                                                                                                                                                    +#
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +require 'shellwords'
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +FILE_BEGIN_REGEXP = /\A\e\[1mdiff/
                                                                                                                                                                                                                                                                                                                                                                                                    +HUNK_BEGIN_REGEXP = /(?=^\e\[36m@@)/
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +# highlight the different inside changed lines while keeping unified output
                                                                                                                                                                                                                                                                                                                                                                                                    +linewise_diff = `git diff --color=always #{ARGV.shelljoin} |
                                                                                                                                                                                                                                                                                                                                                                                                    +( perl /usr/share/doc/git/contrib/diff-highlight/diff-highlight || cat )`
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +linewise_hunks = linewise_diff.split(HUNK_BEGIN_REGEXP)
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +# squash common portions of changed lines and only highlight the differences
                                                                                                                                                                                                                                                                                                                                                                                                    +# http://neurotap.blogspot.com/2012/04/character-level-diff-in-git-gui.html
                                                                                                                                                                                                                                                                                                                                                                                                    +charwise_diff = `git diff --color=always --color-words \
                                                                                                                                                                                                                                                                                                                                                                                                    +--word-diff-regex='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+' #{ARGV.shelljoin}`
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +charwise_hunks = charwise_diff.split(HUNK_BEGIN_REGEXP).map do |hunk|
                                                                                                                                                                                                                                                                                                                                                                                                    +  # nullify character-wise diffs that don't give any whitespace information
                                                                                                                                                                                                                                                                                                                                                                                                    +  if hunk =~ /\S\e\[3[12]m.*?\e\[m/
                                                                                                                                                                                                                                                                                                                                                                                                    +    # highlight headers to indicate that these character-wise diffs are
                                                                                                                                                                                                                                                                                                                                                                                                    +    # alternate representations of the line-wise diffs that precede them
                                                                                                                                                                                                                                                                                                                                                                                                    +    # and also highlight the changes themselves in character-wise diffs
                                                                                                                                                                                                                                                                                                                                                                                                    +    hunk.gsub(/\A\e\[36(?=m@@)|\e\[3[12](?=m.*?\e\[m)/, '\&;7')
                                                                                                                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +# combine the diffs by joining the charwise output into the linewise output
                                                                                                                                                                                                                                                                                                                                                                                                    +# and use uniq() to show only one copy of common hunks between both outputs
                                                                                                                                                                                                                                                                                                                                                                                                    +diff = linewise_hunks.zip(charwise_hunks).map(&:uniq).flatten.map do |hunk|
                                                                                                                                                                                                                                                                                                                                                                                                    +  if hunk =~ FILE_BEGIN_REGEXP
                                                                                                                                                                                                                                                                                                                                                                                                    +    # strip diff headers and git index headers which mention /tmp/* files
                                                                                                                                                                                                                                                                                                                                                                                                    +    hunk.sub(/\A.+\bexpect.+\bbutwas.+\n\e\[1mindex.+\n/, '').
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +    # provide human-friendly descriptions of MiniTest value assertions
                                                                                                                                                                                                                                                                                                                                                                                                    +    sub(/(?<=m-{3}\s)\S+?\bexpect\S+/,  'I expected it to be...').
                                                                                                                                                                                                                                                                                                                                                                                                    +    sub(/(?<=m\+{3}\s)\S+?\bbutwas\S+/, 'but it actually was...').
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +    # color-code file headers according to difference highlighting colors
                                                                                                                                                                                                                                                                                                                                                                                                    +    sub(/^\e\[1(?=m-{3})/, '\&;31').sub(/^\e\[1(?=m\+{3})/, '\&;32')
                                                                                                                                                                                                                                                                                                                                                                                                    +  else
                                                                                                                                                                                                                                                                                                                                                                                                    +    hunk
                                                                                                                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                                                                                                                    +end.join
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +# use blue instead of green for users who indicate that they are colorblind
                                                                                                                                                                                                                                                                                                                                                                                                    +diff = diff.gsub(/(\e\[[\w;]*\b3)2m/, '\14m') if ENV['COLORBLIND']
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +print diff
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Ruby on Rails integration

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Installing the above gdiff script is not enough for Ruby on Rails (which +provides its own, plain “expected but was” message for assertion failures) +so the following monkeypatch is necessary in your test helper to override +Ruby on Rails’ assertion failure messages with MiniTest’s native diffing.

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    class Minitest::Unit
                                                                                                                                                                                                                                                                                                                                                                                                    +  alias _0dcfe0e3_de10_40df_bc94_da27aa85c215 puke
                                                                                                                                                                                                                                                                                                                                                                                                    +  def puke klass, meth, e
                                                                                                                                                                                                                                                                                                                                                                                                    +    if e.message =~ /\\A<(.*?)> expected but was\\n<(.*?)>\\.\\Z/m
                                                                                                                                                                                                                                                                                                                                                                                                    +      e.message.replace Object.new.extend(Minitest::Assertions).diff($1, $2)
                                                                                                                                                                                                                                                                                                                                                                                                    +    end
                                                                                                                                                                                                                                                                                                                                                                                                    +    _0dcfe0e3_de10_40df_bc94_da27aa85c215 klass, meth, e
                                                                                                                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    After adding the above snippet to your test/test_helper.rb file, you +should now see the forementioned gdiff script being used in Ruby on Rails!

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Updates


                                                                                                                                                                                                                                                                                                                                                                                                    Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                    Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/moergo-glove80-keyboard-layers.pdf b/moergo-glove80-keyboard-layers.pdf index 952d22d6b51c390529e863b1466cfcf2f7afe259..4ecabe7518db046bfc1ae5c0de5b5637a80b7590 100644 GIT binary patch delta 110 zcmbO`t$6;l;)WK+7N!>F7M2#)7Pc1l7LFFq7OocV7M>Q~7QPn#7J(MQ7NHj57LgXw z7O@ub7Ks+g7O58LEi%VWsjs>o6C-M0KefU2K}=r5oE881G!-;31*gA0C1V5tZ{I43 delta 108 zcmbO~t$6OV;)WK+7N!>F7M2#)7Pc1l7LFFq7OocV7M>Q~7QPn#7J(MQ7NHj57LgXw y7O@ub7Ks+g7O58LEi%VWsoG{&M47ZsnSMLWEI(rJn-~pE1q}?b>2FWT7y$tIDkwPs diff --git a/moergo-glove80-keyboard.html b/moergo-glove80-keyboard.html new file mode 100644 index 0000000..791a61f --- /dev/null +++ b/moergo-glove80-keyboard.html @@ -0,0 +1,1351 @@ +MoErgo Glove80 programmable ergonomic keyboard - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                    MoErgo Glove80 programmable ergonomic keyboard

                                                                                                                                                                                                                                                                                                                                                                                                    Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    NOTE: Check out the interactive layer map for this keyboard below!
                                                                                                                                                                                                                                                                                                                                                                                                    +DEMO: Watch this video of me typing on this keyboard at 100+ WPM.

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Photograph of my MoErgo Glove80 keyboard. +

                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Is that… Batman’s keyboard?! 🦇 No, but it sure makes me feel like him: + sitting in the turquoise glow of the Batcomputer, deep within the quiet + solitude of the Batcave, saving the world with this ergonomic marvel!

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    This is my MoErgo Glove80 keyboard: a split, columnar, contoured, and wireless +ergonomic marvel that has become my “endgame” choice for the foreseeable future. +Previously, I used an Ergohaven Remnant +keyboard for 6 months, a Dactyl Manuform 5x6 +keyboard for a year, an ErgoDox EZ keyboard for 6 years, and a Kinesis +Advantage keyboard for 11 years prior — all on the quest for better ergonomics.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    1. Review
                                                                                                                                                                                                                                                                                                                                                                                                      1. Impression
                                                                                                                                                                                                                                                                                                                                                                                                        1. Adaptation
                                                                                                                                                                                                                                                                                                                                                                                                          1. Comparison
                                                                                                                                                                                                                                                                                                                                                                                                          2. Layers
                                                                                                                                                                                                                                                                                                                                                                                                            1. Lower layer
                                                                                                                                                                                                                                                                                                                                                                                                              1. Typing layer
                                                                                                                                                                                                                                                                                                                                                                                                                1. Gaming layer
                                                                                                                                                                                                                                                                                                                                                                                                                2. Cursor layer
                                                                                                                                                                                                                                                                                                                                                                                                                  1. Mouse usage
                                                                                                                                                                                                                                                                                                                                                                                                                    1. Arrow keys
                                                                                                                                                                                                                                                                                                                                                                                                                      1. Select & edit
                                                                                                                                                                                                                                                                                                                                                                                                                      2. Number layer
                                                                                                                                                                                                                                                                                                                                                                                                                        1. Date & time
                                                                                                                                                                                                                                                                                                                                                                                                                          1. Arithmetic
                                                                                                                                                                                                                                                                                                                                                                                                                            1. Prefix signs
                                                                                                                                                                                                                                                                                                                                                                                                                              1. Inequalities
                                                                                                                                                                                                                                                                                                                                                                                                                                1. Vim navigation
                                                                                                                                                                                                                                                                                                                                                                                                                                2. Function layer
                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Symbol layer
                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Spacegrams
                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Base layer affinity
                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Vim editor shortcuts
                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Pinching bigrams
                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Vertical bigrams
                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Adjacent bigrams
                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Inward rolling bigrams
                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Outward rolling bigrams
                                                                                                                                                                                                                                                                                                                                                                                                                                                  2. Mouse layer
                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. System layer
                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Emoji layer
                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. emoji.yaml
                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. World layer
                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. world.yaml
                                                                                                                                                                                                                                                                                                                                                                                                                                                        3. Firmware
                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Fine-tuning the timing
                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Mirroring horizontally

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Review

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Embodying a thoughtful, humanistic design that is forgiving (accommodating a broad range of hand sizes and shapes), inviting (like a lounge chair whose intuitive shape beckons weary hands to perch down for some well deserved rest), and futuristic (like some advanced Space Age technology that Batman would use), the Glove80 provides a comfortable, efficient, and delightful typing experience.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            For me, the Glove80 is like a dream come true because it brings together the best features of all the keyboards I’ve used so far on my quest for ergonomics:

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Ergonomic keyboardDuration of useSplit design?Contoured keywells?Columnar layout?Programmable firmware?Low height?Wireless capable?
                                                                                                                                                                                                                                                                                                                                                                                                                                                            MoErgo Glove80 🏆6 months
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Ergohaven Remnant6 months
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Dactyl Manuform 5x61 year
                                                                                                                                                                                                                                                                                                                                                                                                                                                            ZSA ErgoDox EZ6 years
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Kinesis Advantage11 years🌔🌒
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Goldtouch Adjustable1 year🌓
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Microsoft Natural Elite2 years🌒
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            I especially revered the Kinesis Advantage for its unconventional yet ingenious design, but I often wished it were split so that I could separate the keywells at shoulder width apart for a more relaxed, natural stance. Thus I embarked on a split keyboard journey, sacrificing keywells in favor of a split design. 💔 Fortunately, my original wish has now been granted: the Glove80 delivers it all!

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Impression

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            My first impressions of this keyboard, after connecting it to my computer, were:

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Everything feels very reachable, like fitting into a pair of gloves! In particular, the top-row pinky key (Q on QWERTY) is the best I’ve ever felt.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Excellent thumb cluster: the lower arc follows my thumb’s natural motion perfectly, and the nearest upper arc key is also reachable without effort.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • The keycaps’ POM material is delightfully smooth and slippery, making it easy (and fun) to slide fingers across. It’s kind of like having wheels on ergonomic office chairs: you can move around your desk while you multitask.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Key travel is shorter than the Cherry MX switches I’m accustomed to, which is great because I can feel less effort is needed to fully press each key.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • The positioning of the function keys (which are offset by one key above the number row) makes sense now: the missing F6 cut-out on the left half is out of reach unless I shift my palm off its comfortable perch on the palm rest.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • The keyboard is very light, making it easy to lift and reposition to suit the task and posture (whether I’m sitting or standing at my desk) at hand.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Adaptation

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            On my first day using the Glove80, coming from an Ergohaven Remnant keyboard, I felt right at home: achieving 100 WPM on MonkeyType, as shown below. And this speed is with home row mods, disambiguated by ZMK’s global-quick-tap feature! 🚀

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            First day on Glove80: achieved 100 WPM on MonkeyType! +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Key travel is definitely less pronounced on the Glove80’s special-order Choc v1 Red key switches, which allows for a more rapid inter-key typing speed, and the tighter key spacing afforded by Choc switches (compared to MX switches) along with the Glove80’s ergonomic curvature are helping to minimize finger travel around the keyboard. With more practice (just normal usage over time), I feel confident that I can increase my touch-typing speed even further on the Glove80.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Porting my QMK keymap from the Remnant over to ZMK on the Glove80 was challenging, mainly because my home row mods disambiguation logic is so complex. Notably, I worried whether I would be able to translate all the nuances of my QMK patch (which took over 6 months of occasional development to master) to ZMK, but thankfully it was significantly simpler than what I had imagined: without modifying ZMK source code or writing C extensions, I was able to port nearly all of that monstrous sophistication using declarative snippets of custom behaviors!

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Comparison

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Bird's eye view of my Glove80 and Remnant keyboards. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            In terms of quality, the Glove80 is strong yet light: hallmarks of high-end polycarbonate material, which is also used to make optical lenses in eyeglasses. This stands opposite to the Remnant’s light yet fragile 3D-printed construction, which requires careful handling since it can be damaged easily, say, if dropped.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            In terms of height, the Glove80 achieves a lower height profile due to its center of gravity (its keywell nearly touches the desk!) in combination with low-profile Choc switches and keycaps. Even at its tallest point, the Glove80 still stands below the height of the Remnant’s top-inner corner key (number 5).

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Outer profile: looking from the left side toward the center. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            👆 Outer profile: looking from the left side toward the center.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Inner profile: looking from the center toward the left side. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            👆 Inner profile: looking from the center toward the left side.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Front profile: looking from the palm rest toward the back. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            👆 Front profile: looking from the palm rest toward the back.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Back profile: looking from the back toward the palm rest. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            👆 Back profile: looking from the back toward the palm rest.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            In terms of weight, the Glove80 feels much lighter than the Remnant even though it weighs negligibly more: using a kitchen scale, I observed that the right half of the Glove80 (with palm rest) weighed 9.7oz / 275g whereas the Remnant’s (without palm rest) weighed 9.6oz / 272g. However, the Glove80’s weight is more evenly distributed over its surface so it doesn’t feel as heavy when you lift it up; whereas the Remnant’s shape is more condensed, bulkier, and harder to grasp.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            In terms of mobility, the Glove80’s two halves always communicate wirelessly whereas the left half can be wired, wireless, or both (since it supports connecting to 5 devices simultaneously: 4 Bluetooth devices and 1 USB device). This allows both halves, especially the right half, to be repositioned at will. For instance, I sometimes need more writing space on my desk to take notes or doodle, so I simply lift the right half up & away to make room for my notebook. And when I’m finished, I simply move the right half back into position: setting it down wherever I find is comfortable for me, approximately at shoulder width. This is in stark contrast to the Remnant, which is always and only wired to USB. As a result, I’m hesitant to reposition the Remnant’s two halves freely because that may disturb their perfect symmetry, which is tedious to restore accurately.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            In terms of compatibility, the Glove80 works flawlessly with wireless Bluetooth devices, like smartphones, as well as wired USB devices, like laptops. The former is especially remarkable: I connected my Glove80 to my smartphone as an experiment to type in a passphrase (why struggle with a virtual on-screen keyboard when you’ve got the real thing Bluetooth-enabled?) and I was amazed! 🤩 This has unlocked a massive productivity boost for the otherwise inefficient smartphone user interface. It’s quite the game changer: Glove80 for the win! ❤️‍🔥

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            In terms of firmware, the Glove80’s online layout editor makes it easy to customize the keymap and share it with others: there is a free-form text box for notes alongside a “Custom Defined Behaviors” box for ZMK configuration snippets, which lets you implement advanced features such as home row mods disambiguation. And once you’ve built and downloaded your keymap from the online layout editor, flashing the resulting *.uf2 file is a simple drag & drop operation after entering bootloader mode, which has a robust hardware fail-safe of holding particular keys while powering on the keyboard, as documented in the user guide.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            In terms of documentation, the Glove80 comes with a comprehensive user guide that covers everything from ergonomics to soldering; gentle introductory emails when your order is being prepared for shipment; and a helpful Discord community so thoughtful and engaging that I look forward to participating in it every day.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            In terms of support, the Glove80’s inventors are active participants in the Discord community, and they’re reachable directly by email and other means too; their professional demeanor and responsiveness is often applauded by customers. This is significantly better than the Remnant’s support, where language and cultural differences sometimes complicate communication and problem resolution.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Overall, the Glove80 is a phenomenal upgrade over the Remnant and all other ergonomic keyboards I’ve used before. It’s like a dream come true: I love it! 👌

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Layers

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            The keyboard boots up into the following default “base” layer when powered on. +When held, the purple keys in the thumb +clusters activate the subsequent layers according to the legendary Miryoku’s +6-layer design with 3-key thumb activation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Download: This layer map is also available as a printable PDF document. +Interactive: Hover your mouse over the purple keys to see each layer! +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            The keys are arranged in my variation of Arno Klein’s Engram +2.0 layout and they’re imbued with the legendary Miryoku home +row mods tamed with enhancements.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Going beyond Miryoku, I have added a custom layer locking feature whereby a +Miryoku layer can be set to remain active even after you release its thumb key: +while holding the Lower key, simply tap your desired Miryoku layer’s thumb +key. To unlock the layer, tap the Lower key again on the same hand as its +thumb key.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lower layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            This layer provides a layer locking facility for the other layers in the keymap:

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • To lock a layer: Hold the Lower key (one of the black star keys in the +diagram) and tap the thumb cluster key for the layer you want to lock into.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • To unlock a layer: Tap any “Unlock layer” key on the layer you’ve locked.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Typing layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            This layer temporarily disables Miryoku layers and home row modifiers so that you +can focus on typing, without the risk of activating them unintentionally. It’s +meant for practicing your touch-typing skills and is helpful for newcomers.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Gaming layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            This layer repositions the WASD cluster to better fit the Glove80’s ergonomic +curvature while retaining the conventional placement of the pinky finger’s keys. +Consequently, the index finger’s home position is shifted down by one row (on the +“D” key) instead of the home row (on the “E” key), as marked in the diagram.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            It also replicates the first column of the right half of the keyboard on the left +half because it’s common practice in games to place hotkeys on both central +columns as they assume close proximity on conventional row-staggered keyboards. +For example, notice how the home row ends with F and so the G wraps back around.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Similarly, it also replicates nearby hotkeys (such as M for map) on the top.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Cursor layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Mouse usage

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Many keys from the right half are mirrored on the left half for more convenient +right-handed mouse usage. For example, you can select and drag with your right +hand on the mouse while cutting, copying, and pasting with your left hand on +the keyboard. Similarly, you can undo & redo and run the text selection macros too.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Arrow keys

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            The up/down arrow keys on the right-hand home row diverge from Vim’s HJKL order +to avoid double-duty on the index finger for HJ (left & down directions) so that +each home row finger is only responsible for a single direction; and also because +it feels more natural to follow the inward-rising curve of the keyboard’s +contoured keywell, which elevates the thumb above the pinky finger and, +similarly, the middle finger (up arrow) above the ring finger (down arrow).

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            This is a longstanding preference that I formed 17 years ago, in my early days of +using the Kinesis Advantage with the Dvorak layout, whose lack of HJKL provided +the freedom to reimagine the arrangement of arrow keys on the home row.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Select & edit

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Editing (index finger) and selection (thumb cluster) keys line the inner wall. +This opposition allows for pinching, where selections can be followed by edits. +For example, to copy everything, I would first tap the “Select all” key with my +thumb and then pinch slightly inward to tap the “Copy” key with my index finger.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            The copy and paste keys are stacked vertically, in that order, to allow the index +finger to rake down upon them in a natural curling motion toward the palm. This +order is also logical, since pasting requires something to be copied first.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            The select & extend word/line keys on the thumb cluster are ZMK macros that approximate +Pascal Getreuer’s word selection QMK macro, which automates common +selection tasks that require holding down Control and Shift with the arrow keys:

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +Video demonstration of Pascal Getreuer's word selection QMK macro
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            These keys can be combined with the Shift modifier to reverse their direction. +In some apps, the select word key cycles to the next successive word each time!

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Number layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            A 3x3 numeric keypad (using the standard 10-key layout) occupies the home block. +The period and comma keys are positioned near the zero key on the thumb cluster.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Date & time

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            The slash and minus keys are positioned for MM/DD and YYYY-MM-DD date entry. +Similarly, the colon key is positioned above them for HH:MM:SS time stamp entry.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • : time stamp separator
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • - ISO-8601 date separator
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • / American date separator
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Arithmetic

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Common arithmetic operators pair along the sides of the 3x3 numeric keypad.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • % and : for percentages and proportions
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • + and - for addition and subtraction
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • * and / for multiplication and division
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Prefix signs

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Signs that commonly prefix numbers line the top of the 3x3 numeric keypad.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ~ approximately
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • # literal number
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • $ dollar amount
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • @ at the rate of
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Inequalities

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Comparison operators are positioned along the perimeter of the home block.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • < less than
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • > greater than
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • = equal to
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ~ approximately
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Vim navigation

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Vim navigation operators (prefixed by a number N) fill the rightmost column:

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • k goes up N lines
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • j goes down N lines
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • G goes to line number N
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • | goes to column number N
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Function layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            The function keys are arranged in the same 10-key layout as the Number +layer’s 3x3 numeric keypad so that you can develop common muscle +memory for both layers. The remaining F10-F12 keys wrap around the home block +because they’re found in shortcuts such as BIOS save/quit, fullscreen toggle, +and devtools, respectively.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Symbol layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            This is the crown jewel of my keyboard’s configuration: an entire layer dedicated +to the entry of symbols that are essential for computer programming. +It’s the result of several hundreds of layout iterations over the last 9+ years.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Video: Tour of my Symbol layer, with examples in Vim.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            👉 +Red quotes. +Green arrows. +Blue groups. +Purple flips. +Yellow Vim.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • \ is on the thumb for escaping all other symbols without moving your hand.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • For snake_case, _ is at the same spot as English’s most frequent letter e.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • For assignment, = is on the home row because it’s frequent in programming.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • For strings, common quotation marks are found at the top of the home block.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • For function calls, ();, is above the home block, inward-rolling rightward.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Bitwise |& and arithmetic -+ operators “flap down” and “fold up” together.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Angling arrows ->, =>, <=, <-; functional programming pipes |>, <| abound!
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Overall, the guiding principle for this layer’s design is to favor inward rolls.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Next, I also consider the ergonomics (i.e. what feels comfortable) of the +keyboard. For example, inward rolls starting with the pinky finger are easier to +perform from the home and upper rows when compared to the lower and bottom rows. +This is why I’ve placed ! on the upper row instead of the lower row, where ~ +is.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Finally, I also consider clustering, balance, and base layer affinity. For +example, ! on the upper pinky rolls into () for grouped negation !() and +also into ? for interrobang !?. Similarly, () rolls into ? for optional +group capture ()? in regular expressions. In this way, I feel that !, (), +and ? are balanced.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Spacegrams

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Video: Tour of my Spacegram operators, at timestamp 10:14.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            When typing two symbols separated by a space, I have to first let go of the symbol layer access key (also on spacebar) after the first symbol and then tap space and finally reactivate the symbol layer for the second symbol. 😩 I learned a few months ago that this anti-pattern is called a “spacegram” and I’ve already made some progress to minimize its disruption by configuring the spacebar separately from the rest of the Miryoku thumb layer activation keys, but that wasn’t enough! 😤

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            So I came up with the following revised design for the Symbol layer that puts spacebar (as well as backspace and enter) on the right hand. 🥼✨ This way, we don’t need to exit the Symbol layer to type spaces, newlines, or even to correct mistakes! 🤯 It has eliminated the delicately timed dance around the spacebar for me when programming now. 😎👌

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Click to watch video +Demonstration of typing Rust code using Spacegram operators.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Base layer affinity

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • \ is on the same key as Escape on the base layer: they both escape things.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ~ is on the same key as Shift on the base layer: they both invert things.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • (); sits just above the inward-rolling “you” sequence in the Engram layout.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Vim editor shortcuts

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ^ and $ are on the home row, for jumping to the start/end of current line.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • # and * are on the home row, to search behind/ahead for word under cursor.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • = is on the home row, to automatically indent current line or selection.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ( and ) are above the home block, for jumping to previous/next sentence.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • { and } are on the home block, for jumping to previous/next paragraph.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • < and > are on the home block, for decreasing/increasing indentation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • [ and ] are below the home block, for addressing previous/next things.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ? and / are stacked vertically, to search behind/ahead for regex pattern.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • % is on the thumb’s home key, for jumping to cursor’s matching delimiter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • : is on the middle thumb key, for entering Vim’s command mode comfortably.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • :% is an inward swipe by the thumb, for a command across the whole buffer.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Pinching bigrams

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ?. for the optional chaining operator in JavaScript.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • *. for regular expressions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • /. for directory matching in filesystem globs.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Vertical bigrams

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • #! for shebang lines in UNIX scripts.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • !~ for regular expression “not matching” in Perl, Ruby, and Elixir.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • /* and */ for multi-line comments in C, CSS, and JavaScript.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Adjacent bigrams

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • #! for shebang lines in UNIX scripts.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • -> for thin arrows in C, C++, and Elixir.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • () for parentheses.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • .* for filesystem globs.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • *. for regular expressions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • /* and */ for multi-line comments in C, CSS, and JavaScript.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • \. for literal period in regular expressions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • :% is an inward swipe by the thumb for a Vim buffer-wide command.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Inward rolling bigrams

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • () for parentheses.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • <> for angle brackets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • [] for square brackets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • {} for curly braces.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • (); for zero-arity function calls in C and related languages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ); for function call statements in C and related languages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • (" for starting a string value argument for a function call.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • [" for starting a string value for a list or hashtable lookup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • =" for HTML attributes and Bourne shell variable assignments.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • .* for regular expressions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ~/ for home directory paths in UNIX.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • <- for assignment in R and in Elixir’s with statements.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • -> for thin arrows in C, C++, and Elixir.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • => for fat arrows in Perl, Ruby, and Elixir.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • != for “not equal to” value comparison in many languages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • <= for “less than or equal to” comparison in many languages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ^= for bitwise XOR assignment in C and related languages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • |> for the pipe operator in Elixir.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • !( for negating a group in Boolean expressions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • "$ for quoted variable substitution in Bourne shell.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • !$ for last argument of previous command in Bourne shell.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • $? for exit status of previous command in Bourne shell.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • <% for directive tags in Ruby’s ERB and Elixir’s EEx templates.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • <? for directive tags in PHP templates.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • #{ for string interpolation in Ruby and Elixir.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • `' for legacy curly quotes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • </ for element closing tags in XML and HTML.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ~> for pessimistic version constraint in SemVer.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • \. for literal period in regular expressions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ~/ for home directory paths in UNIX.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • !? for interrobang in English prose.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Outward rolling bigrams

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • =~ for regular expression matching in Perl, Ruby, and Elixir.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • -= for negative accumulation in C and related languages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • += for accumulation in C and many languages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • %= for modulo assignment in C and related languages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • >= for “greater than or equal to” value comparison.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • >& and &< for file descriptor redirection in Bourne shell.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • $_ for value of last argument of previous command in Bourne shell.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • $< for the first source of a rule in Makefile.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • $^ for all sources of a rule in Makefile.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • $@ for the target of a rule in Makefile.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • %> for directive tags in Ruby’s ERB and Elixir’s EEx templates.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ?> for directive tags in PHP templates.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ${ for variable interpolation in Bourne shell.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • %{ for maps (hash tables) in Elixir.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ?! for interrobang in English prose.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Mouse layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Movement keys are located centrally in the home block, surrounded by wheel keys.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Mousewheel down/up keys are also placed on the home block, specifically on +the same keys as J/K (down/up in Vim) on the base layer for muscle memory reuse.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            System layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Keys for controlling RGB matrix settings line the central rows of home block. +Keys for power and the traditional print->pause triplet line the thumb cluster.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Emoji layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Consistent with the cardinal directions of the arrow keys on the cursor layer, +these Emojis are organized into logical groups of 4 (and more) within each row.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Customizable preset selections for skin tone, hair style, and gender sign are +arranged on the home row so you can inward-roll them together in one swoop. See +the #define EMOJI_*_PRESET settings in the ZMK snippet for more information.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Here are some examples (as illustrated interactively in the diagram above):

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Using skin tone: 💁+🏿=💁🏿
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Using gender sign: 💁+ZWJ+♀️=💁‍♀️
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Using both of the above: 💁+🏿+ZWJ+♀️=💁🏿‍♀️
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Creating a family of 2: 👨+ZWJ+👧=👨‍👧
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Creating a family of 3: 👨+ZWJ+👩+ZWJ+👧=👨‍👩‍👧
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Creating a family of 4: 👨+ZWJ+👩+ZWJ+👧+ZWJ+👦=👨‍👩‍👧‍👦
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Feeding a baby bottle: 👨+ZWJ+🍼=👨‍🍼
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            emoji.yaml

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            This file in the source repository for this +keymap’s firmware defines the above. You can customize this file to suit your +needs, as it’s already Unicode enabled.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            # modifiers
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +zwj: "\u200d"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +male_sign: "♂️"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +female_sign: "♀️"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +right_arrow: "➡️"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +left_arrow: "⬅️"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# skin tones
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +light_skin_tone:        "🏻"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +medium_light_skin_tone: "🏼"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +medium_skin_tone:       "🏽"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +medium_dark_skin_tone:  "🏾"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +dark_skin_tone:         "🏿"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# family & ages
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +baby_bottle: "🍼"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +baby: "👶"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +boy: "👦"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +girl: "👧"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +man: "👨"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +woman: "👩"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +old_man: "👴"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +old_woman: "👵"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# hair styles
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +white_hair: "🦳"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +curly_hair: "🦱"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +red_hair: "🦰"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +bald: "🦲"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# function row
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +new_moon: "🌑"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +waxing_crescent_moon: "🌒"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +first_quarter_moon: "🌓"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +waxing_gibbous_moon: "🌔"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +full_moon: "🌕"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# number row
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +tada: "🎉"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +fire: "🔥"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +heart: "️❤️"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +muscle: "💪"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +person_climbing: "🧗"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +rocket: "🚀"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# upper row
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +sunglasses: "😎"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +star_struck: "🤩"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +joy: "😂"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +cold_sweat: "😰"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +scream: "😱"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +exploding_head: "🤯"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# home row
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +snap_fingers: "🫰"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +ok_hand: "👌"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +pray: "🙏"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +sweat_smile: "😅"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +disappointed: "😞"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +thinking: "🤔"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# lower row
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +person_tipping_hand: "💁"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +person_gesturing_ok: "🙆"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +person_bowing: "🙇"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +person_raising_hand: "🙋"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +person_gesturing_no: "🙅"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +person_shrugging: "🤷"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# bottom row
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +checkoff: "✅"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +100: "💯"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +warning: "⚠️"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +x: "❌"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +question: "❓"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# thumb cluster upper arc
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +astronaut:  "🧑‍🚀"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +nerd: "🤓"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +sparkles: "✨"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# thumb cluster lower arc
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +raised_hands: "🙌"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +point_up: "☝️"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +thumbs_up: "👍"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            World layer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            This layer overlays Latin characters atop related letters in the vowel cluster. +Modifiers along the right hand’s home row act as sub-layers, working together to +target the desired accented character from each of the overloaded vowel letters.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            legend
                                                                                                                                                                                                                                                                                                                                                                                                                                                            LALTRSFTRALT
                                                                                                                                                                                                                                                                                                                                                                                                                                                            LCTLbaseRCTL
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            For example, tapping Y produces different characters depending on the modifiers:

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            LetterModifierShift?Output
                                                                                                                                                                                                                                                                                                                                                                                                                                                            Yý
                                                                                                                                                                                                                                                                                                                                                                                                                                                            YÝ
                                                                                                                                                                                                                                                                                                                                                                                                                                                            YLCTLÿ
                                                                                                                                                                                                                                                                                                                                                                                                                                                            YLCTLŸ
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            world.yaml

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            This file in the source repository for this +keymap’s firmware defines the above. You can customize this file to suit your +needs, as it’s already Unicode enabled.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            precedence: [LSFT, LALT, RALT, LCTL, RCTL, RSFT] # latter overrides former: RSFT overrides all
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +transforms:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  C: { base: cedilla                                                                         }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  I: { base: acute, LCTL: diaeresis, RCTL: circumflex, RSFT: grave                           }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  E: { base: acute, LCTL: diaeresis, RCTL: circumflex, RSFT: grave,              RALT: ae    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  A: { base: acute, LCTL: diaeresis, RCTL: circumflex, RSFT: grave, LALT: tilde, RALT: ring  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  Y: { base: acute, LCTL: diaeresis                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  O: { base: acute, LCTL: diaeresis, RCTL: circumflex, RSFT: grave, LALT: tilde, RALT: slash }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  U: { base: acute, LCTL: diaeresis, RCTL: circumflex, RSFT: grave                           }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  N: { base: tilde                                                                           }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +characters:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  C:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    cedilla:    { lower: "ç", upper: "Ç" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  I:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    acute:      { lower: "í", upper: "Í" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    diaeresis:  { lower: "ï", upper: "Ï" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    circumflex: { lower: "î", upper: "Î" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    grave:      { lower: "ì", upper: "Ì" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  E:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    acute:      { lower: "é", upper: "É" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    diaeresis:  { lower: "ë", upper: "Ë" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    circumflex: { lower: "ê", upper: "Ê" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    grave:      { lower: "è", upper: "È" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    ae:         { lower: "æ", upper: "Æ" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  A:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    acute:      { lower: "á", upper: "Á" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    diaeresis:  { lower: "ä", upper: "Ä" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    circumflex: { lower: "â", upper: "Â" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    grave:      { lower: "à", upper: "À" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    tilde:      { lower: "ã", upper: "Ã" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    ring:       { lower: "å", upper: "Å" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  Y:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    acute:      { lower: "ý", upper: "Ý" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    diaeresis:  { lower: "ÿ", upper: "Ÿ" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  O:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    acute:      { lower: "ó", upper: "Ó" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    diaeresis:  { lower: "ö", upper: "Ö" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    circumflex: { lower: "ô", upper: "Ô" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    grave:      { lower: "ò", upper: "Ò" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    tilde:      { lower: "õ", upper: "Õ" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    slash:      { lower: "ø", upper: "Ø" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  U:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    acute:      { lower: "ú", upper: "Ú" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    diaeresis:  { lower: "ü", upper: "Ü" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    circumflex: { lower: "û", upper: "Û" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    grave:      { lower: "ù", upper: "Ù" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  N:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    tilde:      { lower: "ñ", upper: "Ñ" }
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +codepoints:
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  degree_sign: "°"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  section_sign: "§"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  paragraph_sign: "¶"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  o_ordinal: "º"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  a_ordinal: "ª"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  exclaim_left: "¡"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  question_left: "¿"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  quote_left: "«"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  quote_right: "»"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Firmware

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            My keyboard’s entire firmware is available on GitHub and discussed on Discord.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Fine-tuning the timing

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Activate the typing layer, launch the QMK Configurator’s +testing tool, and then pretend to use home +row mods. Note the timing & duration of keystrokes reported by the tool +and use them to adjust the #define timing thresholds in my ZMK +port.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Mirroring horizontally

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            To horizontally mirror a keymap’s physical layout in the Glove80 Layout Editor:

                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Activate the “Enable local config” option in the Glove80 Layout Editor’s settings panel under the “Experimental Settings” section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            3. Return to the editor and export your keymap to a JSON file by clicking on the “Download” button.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            5. Paste the contents of the exported JSON file into your Web browser’s JavaScript console (found in the “Developer Tools” panel, typically activated by pressing Ctrl+F12) at the location indicated by the comment in the first line of the following code snippet.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            7. Right-click the result, copy to clipboard, save to file, and upload into the Glove80 Layout Editor. 🫰 Presto! Everything should be mirrored now.
                                                                                                                                                                                                                                                                                                                                                                                                                                                            8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            layout = /* paste contents of exported JSON file here */;
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +mirroring_transformation = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +//
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |------------------------|------------------------|
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | LEFT_HAND_KEYS         |        RIGHT_HAND_KEYS |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |                        |                        |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |  0  1  2  3  4         |          5  6  7  8  9 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 10 11 12 13 14 15      |      16 17 18 19 20 21 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 22 23 24 25 26 27      |      28 29 30 31 32 33 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 34 35 36 37 38 39      |      40 41 42 43 44 45 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 46 47 48 49 50 51      |      58 59 60 61 62 63 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 64 65 66 67 68         |         75 76 77 78 79 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |                69 52   |   57 74                |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |                 70 53  |  56 73                 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |                  71 54 | 55 72                  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |------------------------|------------------------|
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | LEFT_HAND_MIRRORED     |    RIGHT_HAND_MIRRORED |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |                        |                        |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |  9  8  7  6  5         |          4  3  2  1  0 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 21 20 19 18 17 16      |      15 14 13 12 11 10 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 33 32 31 30 29 28      |      27 26 25 24 23 22 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 45 44 43 42 41 40      |      39 38 37 36 35 34 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 63 62 61 60 59 58      |      51 50 49 48 47 46 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// | 79 78 77 76 75         |         68 67 66 65 64 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |                74 57   |   52 69                |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |                 73 56  |  53 70                 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |                  71 54 | 55 72                  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +// |------------------------|------------------------|
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +//
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +   0: 9,  1: 8,  2: 7,  3: 6,  4: 5,                              5: 4,  6: 3,  7: 2,  8: 1,  9: 0,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  10:21, 11:20, 12:19, 13:18, 14:17, 15:16,               16:15, 17:14, 18:13, 19:12, 20:11, 21:10,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  22:33, 23:32, 24:31, 25:30, 26:29, 27:28,               28:27, 29:26, 30:25, 31:24, 32:23, 33:22,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  34:45, 35:44, 36:43, 37:42, 38:41, 39:40,               40:39, 41:38, 42:37, 43:36, 44:35, 45:34,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  46:63, 47:62, 48:61, 49:60, 50:59, 51:58,               58:51, 59:50, 60:49, 61:48, 62:47, 63:46,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  64:79, 65:78, 66:77, 67:76, 68:75,                             75:68, 76:67, 77:66, 78:65, 79:64,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +                                     69:74, 52:57, 57:52, 74:69,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +                                     70:73, 53:56, 56:53, 73:70,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +                                     71:72, 54:55, 55:54, 72:71,
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +};
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +mirrored_layers = layout["layers"].map((layer) => {
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  return layer.map((key,pos) => {
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    return layer[mirroring_transformation[pos]];
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  });
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +});
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +mirrored_layout = Object.assign({}, layout);
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +mirrored_layout["layers"] = mirrored_layers;
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +mirrored_layout; /* dumps to the console for copying */
                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/musc80v-midterm.html b/musc80v-midterm.html new file mode 100644 index 0000000..b13307d --- /dev/null +++ b/musc80v-midterm.html @@ -0,0 +1,110 @@ +From "A Hard Day's Night" to "Help!": changes in The Beatles' music and personality - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                            From "A Hard Day's Night" to "Help!": changes in The Beatles' music and personality

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. References

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The Beatles’ first film A Hard Day’s Night, helped establish their witty +and charming personalities among a broader audience. However, their second +film Help! changed this image into that of a group of meandering fools. +The Beatles, as musicians and song writers, evolved greatly from their teenie- +bopper beginnings in Love Me Do to their sophisticated album Rubber Soul +that defined classic rock.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              In A Hard Day’s Night, the Beatles gained their first chance to +establish a broader consumer base apart from the usual screaming teenage +girls. This was the first time when adults, who payed no heed to teenie-bopper +hits, would come to see the band in a new light. Some critics argue that the +personalities of the Beatles in A Hard Day’s Night are exaggerated, but +as Ringo points out in a 1964 interview: “At first it was hard, because we +wouldn’t learn the lines like you’re supposed to. We’d learn them on the way +to the studio. In a way it might have been better because it was more natural” +[3]. This natural approach in A Hard Day’s Night resulted in the superb +personalities unique to only the Beatles. Their wit and charm, which many have +come to recognize in television shows and newspaper interviews, was exactly +what was portrayed in A Hard Day’s Night. Thus the Beatles’ +personalities in A Hard Day’s Night are very much the real thing.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ringo was a clever and “cheeky” fellow in A Hard Day’s Night. For +example, in a scene where he is being interviewed by a woman who asks “are you +a Maude or a Rocker?”, Ringo responds “I’m a Mocker”. This cleverness was +lacking in Help! where Ringo was a clueless simpleton: falling prey to +obvious traps and reciting dim dialogue; resembling an unintelligible fellow. +Another example in Help!, is where Ringo, who was kidnapped by two +Americans, is rescued from the trunk of their car by George. Ringo doesn’t +bother to escape and simply says “Hello”. Some critics welcome the idea that +the script writers were at fault for Ringo’s lacking role. To them, he was +indeed a clever fellow as portrayed in A Hard Day’s Night and +interviews.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              John was a spontaneous and delightful character in A Hard Day’s Night, +where “you always had to keep your eye on him because you never knew what he +would do next” [1]. For example, in A Hard Day’s Night, the Beatles are +walking through the theater where they would perform; John spots a woman’s hat +with an extravagant ribbon, and says “look it’s a bird!”. Another example is +when John is with the barber and is shaving using an electric shaver, he +suddenly points the shaver at the camera and then winks. However, John’s +humorous spontaneity does not shine in Help! as he is given a mediocre +role supporting Ringo.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              George was a straightforward and cunning fellow in A Hard Day’s Night. +As seen in television shows and interviews, George’s perfect timing with +humorous jokes is spot-on in A Hard Day’s Night. In a scene where George +meets with a Record label manager who tries to take advantage of his +popularity, George is humorously straightforward in refusing the offer. +However, just as the other supporting Beatles, George did not have much of a +role in Help!. He is, however, portrayed as being heroic when he rescues +Ringo from two Americans who kidnap Ringo.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Paul was the charming fellow who acted well with Wilfred Brambell, as his +grandfather in A Hard Day’s Night. His interaction with Wilfred Brambell +was superb as many jokes stemmed from their roles. Paul’s role in Help! +was somewhat more involved than the rest of the Beatles, as he was often the +one contacted by Ahme, played by Eleanor Bron, in the cult that was after +Ringo. However, his role was comically deprived as the type of chemistry +between him and Brambell in A Hard Day’s Night was outstanding compared +to that with Bron in Help!.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              More-so in A Hard Day’s Night than Help!, the oft-made +similarities of the Beatles to the Marx Brothers becomes apparent as the film +is full of clever slap-stick comedy and jokes typical of Marx Brothers. There +is a tighter integration of jokes and spontaneity that shines through the +Beatles’ charming persona in A Hard Day’s Night, compared to poorly +timed and loosely coupled jokes in Help!.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              From their first debut album Please Please Me in 1963 to Rubber +Soul in 1965, the Beatles dramatically evolved both as musicians and song- +writers. Their initial albums consisted of songs all of which could be used in +dance clubs. These songs used mostly intimate words like “you” and “I” and +were focused mainly on teenage love themes. Not surprisingly, their initial +fan-base consisted mainly of teenage girls who fueled Beatle-mania. These +early songs were not at all sophisticated with complex word play as they were +usually love letters and such for teenagers. However, one can find in the +Beatles’ later albums that, no longer were all songs suitable to be used in +dance clubs and themed about teenage love; a new type of Beatles songs +emerged, those with profound poetry and unique melodies which one could simply +listen to and enjoy.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The Beatles began to express their individual styles in later albums, such as +John’s theme of anger, George’s song-writing debut with “Tax Man”, Ringo’s +complex new drumming patterns and Paul’s cheerful and upbeat musical styles. +Lyrics of “Run For Your Life” show John’s anger, with phrases such as “I’d +rather see you dead, little girl” and “Catch you with another man, That’s the +end” [5]. John was also writing down-hearted songs such as “I’m a Loser” in +Beatles for Sale album, and “Nowhere Man” in Rubber Soul. +Alongside musical development, the Beatles’ lyrics become more sophisticated +with poetry and wordplay. Another down-hearted yet poetic song is “Eleanor +Rigby” from Revolver. The lyrics refer to “All the lonely people” using poetic +elements that develop over the course of the song: “No-one comes near … +Nobody came … No-one was saved.” [6]. Such sophisticated lyrics create a +gloomy and yet content mood as one thinks about the song’s message. This type +of creativity was not present in earlier albums and occurs more frequently +throughout later albums.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Although the Beatles’ films established their personalities with the general +audience, it is their progress as musicians and song writers which truly +defined them as a band. The charming and witty bunch from Liverpool may have +been portrayed as fools in Help! but their fantastic work in later +albums such as Rubber Soul and Revolver undoubtedly defines the +genre that is classic rock.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              References

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. The Beatles Anthology, 1996. Documentary. USA: Apple.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              3. Unknown. (2002). The Beatles Ultimate Experience - Beatles Interviews, Photos, and Animations [online]. Available from: http://www.geocities.com/~beatleboy1/ [Accessed 16 August 2003].

                                                                                                                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              5. Unknown. (2002). Movies: A Hard Day’s Night [online]. Available from: http://www.geocities.com/~beatleboy1/dbmovies.html [Accessed 16 August 2003].

                                                                                                                                                                                                                                                                                                                                                                                                                                                              6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              7. Unknown. (2003). The Beatles Lyrics Archive [online]. Available from: http://www.geocities.com/SunsetStrip/Limo/3518/ [Accessed 17 August 2003].

                                                                                                                                                                                                                                                                                                                                                                                                                                                              8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              9. Unknown. (2003). Run For Your Life [online]. Available from: http://www.geocities.com/SunsetStrip/Limo/3518/4urlife.htm [Accessed 17 August 2003].

                                                                                                                                                                                                                                                                                                                                                                                                                                                              10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              11. Unknown. (2003). Eleanor Rigby [online]. Available from: http://www.geocities.com/SunsetStrip/Limo/3518/e_rigby.htm [Accessed 17 August 2003].

                                                                                                                                                                                                                                                                                                                                                                                                                                                              12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/nanase-hikaru-honoka-na-omoi.html b/nanase-hikaru-honoka-na-omoi.html new file mode 100644 index 0000000..2b6ab2e --- /dev/null +++ b/nanase-hikaru-honoka-na-omoi.html @@ -0,0 +1,25 @@ +Transcription of Nanase Hikaru's "Honoka na Omoi" - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Transcription of Nanase Hikaru's "Honoka na Omoi"

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              I finally invested some time to interpret the introductory piano solo of +Nanase Hikaru’s beautiful and heartfelt song Honoka +na Omoi, which means +“thoughts about Honoka”. She composed the song as part of the original +soundtrack of the KimiKiss pure +rouge anime +TV series.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              I have not yet interpreted the dual orchestra and piano passage which follows +the above piano solo beacuse I found it difficult to identify the individual +orchestra instruments. Perhaps I shall revisit this piece once I gain enough +experience to decipher it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Enjoy!

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/one-tab-is-two-spaces.html b/one-tab-is-two-spaces.html new file mode 100644 index 0000000..60c7319 --- /dev/null +++ b/one-tab-is-two-spaces.html @@ -0,0 +1,33 @@ +One tab is two spaces - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                              One tab is two spaces

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                              My adventures in programming started back in 1998 with a primitive text editor +called (gasp!) MS-DOS edit. This editor had no automated indenting facilities, so I was forced me +to manually indent my source code. Under such circumstances, indenting with +tabs was naturally more economical than indenting with spaces, because with +just one press of the tab key, I could produce the effect of pressing the +space bar eight times!

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              During my senior year of high school, I was luckily introduced to the fabulous +jEdit text editor, which serves as my programming text +editor to this day. Like Emacs and Vim, it could:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • display tabs using a configurable number of spaces
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • insert a configurable number of spaces when the tab key is pressed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • indent and unindent one or more lines of code
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              However, I soon felt that tabs were too wide. So I configured my editor to +display tabs with four spaces instead, and discovered that I could see much +more code in the same display than previously possible! Eventually, I came +to prefer the display of tabs as two spaces. As before, this increased the +visual density of code while maintaining the benefits of readability +introduced by indenting.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Today, after six years of indenting purely with tabs, I somehow made the +switch to spaces! Though it seems monumental, my programming habits remain +virtually unchanged. Except now, I use the editor’s magic to unindent, instead +of pressing the back space key.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/oniguruma-negated-regexps.html b/oniguruma-negated-regexps.html new file mode 100644 index 0000000..8dce132 --- /dev/null +++ b/oniguruma-negated-regexps.html @@ -0,0 +1,89 @@ +Negated regular expressions in Oniguruma and Ruby - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Negated regular expressions in Oniguruma and Ruby

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Overview
                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Wholly negated regular expressions
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Partly negated regular expressions
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Conclusion

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      About a week ago, I submitted this feature request asking for the ability to +negate regular expressions in Ruby. I have since implemented the feature +myself by patching Ruby trunk and patching +Oniguruma 5.9.2 beside it. +And now, I shall explain to you how it all works.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Overview

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Regular expressions can be negated either as a whole (/.../v) or in part +/(?v:...)/) through the negation flag (v). The letter v was chosen +for the negation flag because it comes from the ed(1) program of UNIX +heritage, where it serves a global command that negates the sense of the +regular expression passed in. This v heritage can also be found in +grep(1), whose -v command-line +option inverts its matching behavior.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Wholly negated regular expressions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      This is the simplest part of the implementation. We match the negated +regular expression as usual, treating it as if it were not negated, and +then negate the result of that match if there were no matching errors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Partly negated regular expressions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      At parse time, a partly negated regular expression, say r in /(?v:r)/, +is expanded into /(?:rN)?.*?/ where N is a special instruction +(OP_NEGATE) that causes the regular expression matching engine to treat +the input matched thus far as a mismatch.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      For example, the /a(?v:b)c/ parse tree looks like this after expansion:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      PATTERN: /a(?v:b)c/ (US-ASCII)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +<list:275ca40>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +   <string:275c9f0>a
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +   <enclose:275c950> option:4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +      <quantifier:2755640>{0,1}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +         <string:275c9a0>b
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +   <quantifier:2755690>{0,-1}?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +      <anychar:275af20>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +   <string:2755550>c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Since r is wrapped in an optional non-capturing group (/(?:rN)?/), the +matching engine is able to continue onward when r does not match. +However, if r did not match because the matching engine reached +non-matching input characters, then those characters will obstruct the +matching engine from continuing onward. That is why /.*?/ is provided.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      For example, when /a(?v:b)c/ is matched against the input "axyzc", the +non-matching input characters ("xyz") will obstruct the matching engine +from matching the rest of the regular expression (/c/) against the rest +of the input ("xyzc"). However, since /.*?/ consumes "xyz", the +matching engine can proceed to match /c/ against "c".

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Conclusion

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      In all, this was a challenging and fun learning experience for me. I +brushed up on my rusty (thanks Ruby!) knowledge of the C language and the +GDB debugger while also adding some shiny +new tools to my repertoire:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      I have submitted my patches simultaneously to the Ruby developers and to +the author of Oniguruma, and now await their response. If all goes well, +we might see this feature in Ruby and Oniguruma someday. Enjoy! :-]

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                      \ No newline at end of file diff --git a/openag5-typing-microcontroller-pins.html b/openag5-typing-microcontroller-pins.html new file mode 100644 index 0000000..d0efc6a --- /dev/null +++ b/openag5-typing-microcontroller-pins.html @@ -0,0 +1,49 @@ +Tying wires to microcontroller pins - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Tying wires to microcontroller pins

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Progress so far
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. The road ahead
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Progress so far

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I finished building the MON08 programmer +circuit last +week, so the next step was to run wires from the circuit onto the connection +points on the primary +PCB(Printed Circuit Board).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Knots around microcontroller pins +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          At first, I tried soldering 0.25mm wire +wrap wires onto the OSC1 and RESET +pins on the micro-controller. However, the tip of my soldering iron was far +too big (and blunt) for the job, allowing me to accidentally solder the tops +first three pins together!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          What a mess that was! I spent half an hour scraping it away with the tip of a +1.8mm slotted (flat +head) screw driver. +Afterwards, I ensured that that the pins were once again unconnected, +independent, and free using my trusty continuity +tester.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          With that soldering lesson well learned, I proceeded to try a different +approach: I would literally tie wires onto the pins (see photo above). This +was tricky.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I stripped off some insulation from each wire and bent the underlying metal +into a crude “U” shaped hook. After much persistence (though mostly luck, it +seemed) I was able to loop each wire around its corresponding pin. Then it was +just a matter of twisting the excess length of metal around the insulation. +Et viola! A metal knot. :-)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Finally, I secured the wires using masking tape so that they don’t move around +and accidentally cause the knots to touch the neighboring microcontroller +pins.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The road ahead

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Now I need to solder 0.60mm wires to the remaining connection points and try +to read the micro-controller’s flash EEPROM.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Initially, I thought I would have to install Windows XP on my computer +(groan!) just to use the +ICS08JBZ +programmer software to communicate with my MON08 programmer circuit. But +luckily, I found an excellent open source tool called monitor- +68HC08 written by DEMAINE +Benoît-Pierre which does the job. This tool’s +source code will come in handy if I end up having to crack the +microcontroller’s security code by brute force.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/organizing-firefox-bookmarks-with-freemind.html b/organizing-firefox-bookmarks-with-freemind.html new file mode 100644 index 0000000..3dcf74a --- /dev/null +++ b/organizing-firefox-bookmarks-with-freemind.html @@ -0,0 +1,34 @@ +Organizing Firefox bookmarks with Freemind - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Organizing Firefox bookmarks with Freemind

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Here’s how you can organize your Firefox, Camino, Mozilla, Netscape, and +even Internet Explorer bookmarks (they all use the same file format) using Freemind.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Note that on my system, Freemind resides at ~/freemind and my +bookmarks reside at ~/.mozilla/firefox/**default/bookmarks.html.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Install the necessary file conversion tools:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo apt-get install xbel xbel-utils xsltproc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. Netscape to XBEL conversion:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ns_parse ~/.mozilla/firefox/**default/bookmarks.html bookmarks.xbel
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          5. XBEL to Freemind conversion:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            xsltproc -o bookmarks.mm ~/freemind/accessories/xbel2mm.xsl bookmarks.xbel
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          7. Organize your bookmarks using Freemind:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            freemind.sh bookmarks.mm
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          9. Freemind to XBEL conversion:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            xsltproc -o bookmarks_new.xbel ~/freemind/accessories/mm2xbel.xsl bookmarks.mm
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          11. XBEL to Netscape conversion:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            xbel_parse --netscape < bookmarks_new.xbel > bookmarks_new.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          13. Once you are satisfied with your newly organized bookmarks +(bookmarks_new.html), you can overwrite the old ones:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            mv bookmarks_new.html ~/.mozilla/firefox/*default/bookmarks.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/papercolor-terminal-color-scheme.html b/papercolor-terminal-color-scheme.html new file mode 100644 index 0000000..781e2d2 --- /dev/null +++ b/papercolor-terminal-color-scheme.html @@ -0,0 +1,88 @@ +PaperColor terminal color scheme - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          PaperColor terminal color scheme

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          hterm, the official terminal emulator for ChromeOS, has foiled my usual +preference for dark color schemes because its font rendering is optimized for +light backgrounds that are common on the Web, but not for traditional terminals.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Thus, I have ported Vim’s light PaperColor theme to the terminal as follows:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          the color scheme +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          UNIX manual page +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          To use this color scheme in hterm, open the nassh extension’s settings page, +open Chrome Developer Tools, and then run the following snippet in the console:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          term_.prefs_.set("background-color", "#eeeeee");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +term_.prefs_.set("foreground-color", "#444444");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +term_.prefs_.set("cursor-color", "rgba(0,95,135, 0.5)"); /* #005f87 */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +term_.prefs_.set("color-palette-overrides", ["#1c1c1c", "#af0000", "#008700",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +"#d75f00", "#005faf", "#d70087", "#0087af", "#e4e4e4", "#1c1c1c", "#af0000",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +"#008700", "#d75f00", "#005faf", "#d70087", "#0087af", "#e4e4e4"]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          To use this color scheme in Rxvt or XTerm, save the following snippet to a file +such as ~/.Xdefaults and then run xrdb -merge on that file to apply it. Any +terminals launched thereafter will use this color scheme, but not existing ones.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ! Colors from "PaperColor" colorscheme for Vim
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +! https://github.com/NLKNguyen/papercolor-theme
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_0_Color     #1c1c1c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_8_Color     #1c1c1c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_1_Color     #af0000
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_9_Color     #af0000
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_2_Color     #008700
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_10_Color    #008700
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_3_Color     #d75f00
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_11_Color    #d75f00
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_4_Color     #005faf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_12_Color    #005faf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_5_Color     #d70087
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_13_Color    #d70087
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_6_Color     #0087af
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_14_Color    #0087af
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_7_Color     #e4e4e4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Ansi_15_Color    #e4e4e4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Foreground_Color #444444
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Background_Color #eeeeee
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define Cursor_Color     #005f87
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color0       : Ansi_0_Color/*  normal black   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color1       : Ansi_1_Color/*  normal red     */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color2       : Ansi_2_Color/*  normal green   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color3       : Ansi_3_Color/*  normal yellow  */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color4       : Ansi_4_Color/*  normal blue    */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color5       : Ansi_5_Color/*  normal magenta */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color6       : Ansi_6_Color/*  normal cyan    */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color7       : Ansi_7_Color/*  normal white   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color8       : Ansi_8_Color/*  bright black   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color9       : Ansi_9_Color/*  bright red     */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color10      : Ansi_10_Color/* bright green   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color11      : Ansi_11_Color/* bright yellow  */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color12      : Ansi_12_Color/* bright blue    */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color13      : Ansi_13_Color/* bright magenta */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color14      : Ansi_14_Color/* bright cyan    */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*color15      : Ansi_15_Color/* bright white   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*foreground   : Foreground_Color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*background   : Background_Color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Rxvt*cursorColor  : Cursor_Color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color0      : Ansi_0_Color/*  normal black   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color1      : Ansi_1_Color/*  normal red     */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color2      : Ansi_2_Color/*  normal green   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color3      : Ansi_3_Color/*  normal yellow  */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color4      : Ansi_4_Color/*  normal blue    */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color5      : Ansi_5_Color/*  normal magenta */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color6      : Ansi_6_Color/*  normal cyan    */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color7      : Ansi_7_Color/*  normal white   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color8      : Ansi_8_Color/*  bright black   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color9      : Ansi_9_Color/*  bright red     */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color10     : Ansi_10_Color/* bright green   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color11     : Ansi_11_Color/* bright yellow  */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color12     : Ansi_12_Color/* bright blue    */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color13     : Ansi_13_Color/* bright magenta */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color14     : Ansi_14_Color/* bright cyan    */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color15     : Ansi_15_Color/* bright white   */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*colorUL     : Underline_Color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*colorRV     : Reverse_Color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*foreground  : Foreground_Color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*background  : Background_Color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*cursorColor : Cursor_Color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/rails3-gui-api.html b/rails3-gui-api.html new file mode 100644 index 0000000..08317b9 --- /dev/null +++ b/rails3-gui-api.html @@ -0,0 +1,64 @@ +Decoupling GUI from API in Ruby on Rails 3 - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Decoupling GUI from API in Ruby on Rails 3

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. config/routes.rb
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. app/controllers/application_controller.rb
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. app/controllers/users_controller.rb

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Having built web applications with Rails 3 and Sencha ExtJS for the past +year or so, I developed a simple way to decouple GUI concerns from APIs:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                If a format is specified in the requested URI, then serve the API. +Otherwise, serve the GUI while indicating that the response is +non-authoritative, using HTTP status code 203.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The implementation, from routes to controllers, is demonstrated below. +For example, when GET /users is requested, the GUI is served; but when +GET /users.json is requested, the API is served. Similarly, when POST +/users is requested, the GUI is served; but when POST /users.json is +requested, the API is served and it responds with the newly created user.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                config/routes.rb

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                # You can have the root of your site routed with "root"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +# just remember to delete public/index.html.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +root :to => 'application#index'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +# pass unknown URLs to GUI (HTML5 history.pushState)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +# http://railscasts.com/episodes/46-catch-all-route
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +match '*path' => 'application#index'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                app/controllers/application_controller.rb

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                # serve GUI when no format is specified
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +before_filter do
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  unless params[:format]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    render nothing: true, layout: true, status: :non_authoritative_information
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +# serve API when a format is specified
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +def index
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  respond_with nil, location: nil, status: :not_implemented
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +alias new     index
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +alias create  index
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +alias show    index
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +alias edit    index
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +alias update  index
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +alias destroy index
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +# serve these formats in respond_with()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +respond_to :json
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                app/controllers/users_controller.rb

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                class UsersController < ApplicationController
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  def create
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    user = User.new(params[:user])
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    respond_with(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +        success: !!user.save,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +        errors: user.errors,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +        user: user,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      location: url_for(user)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    )
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/revival-of-the-ruby-vpi-project.html b/revival-of-the-ruby-vpi-project.html new file mode 100644 index 0000000..2e3875d --- /dev/null +++ b/revival-of-the-ruby-vpi-project.html @@ -0,0 +1,48 @@ +Revival of the ruby-vpi project - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Revival of the ruby-vpi project

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                A week ago, I was in search of Verilog TF, ACC, or VPI bindings for Ruby in +order to simplify the task of writing a fairly complex Verilog test bench. +Luckily, I came across Kazuhiro HIWADA’s ruby-vpi +extension

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                This extension, through clever use of pthreads and mutual exclusion, enabled +me to run a Ruby script from within Verilog via the standard PLI callback +mechanism. However, that was the extent of its ability; it did not provide a +means to pass parameters back and forth between Verilog and Ruby.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Naturally, I began implementing the ability to pass parameters and access the +Verilog module under test via the VPI specification. After a few sleepless +days, my hard work—although a bit hackish—paid off.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                I tried my best to contact the original author, Mr. Hiwada, in hopes of +contributing my additions to him. However, I failed to locate a more recent +means of contact than his e-mail address listed on his old (1999) +website.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Alas, it seemed that ruby-vpi was genuinely abandoned. So I decided to revive +this wonderful project and coordinate further development through rubyforge.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                I would like to thank Mr. Hiwada for creating the basic infrastructure for +this project, so many years ago. I shall now continue his noble work alongside +my Masters thesis for which I hope to utilize this extension.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/ruby-1.9.3-p0-power-efficiency.html b/ruby-1.9.3-p0-power-efficiency.html new file mode 100644 index 0000000..2ad454d --- /dev/null +++ b/ruby-1.9.3-p0-power-efficiency.html @@ -0,0 +1,63 @@ +Ruby 1.9.3 power efficiency ends wmiirc woes - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Ruby 1.9.3 power efficiency ends wmiirc woes

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                For those who were weary of my Ruby +wmiirc’s power consumption, I am +happy to announce that the latest Ruby 1.9.3-p0 stable release has solved +Ruby’s problem of causing excessive CPU wakeups-from-idle which would drain +your laptop battery much sooner than you’d expect.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                On my ASUS UL30A-A2 laptop running Arch Linux, +powertop shows that Ruby +1.9.3-p0 running my wmiirc causes 2 CPU wakeups-from-idle per second:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +Top causes for wakeups:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +34.6% (101.0)   chromium
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +16.1% ( 46.9)   [hda_intel] <interrupt>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +12.8% ( 37.5)   [kernel scheduler] Load balancing tick
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +10.4% ( 30.4)   kworker/0:0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 4.0% ( 11.6)   SignalSender
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 3.8% ( 11.1)   [kernel core] hrtimer_start (tick_sched_timer)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 3.8% ( 11.0)   [ath9k] <interrupt>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 3.8% ( 11.0)   kworker/u:2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 1.7% (  5.0)   syndaemon
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 1.6% (  4.6)   [acpi] <interrupt>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 1.4% (  4.0)   [kernel core] usb_hcd_poll_rh_status (rh_timer_func)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.9% (  2.5)   wmii
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.7% (  2.1)   liferea
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.7% (  2.0)   [ahci] <interrupt>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.7% (  1.9)   ruby
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.5% (  1.6)   X
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.4% (  1.2)   ario
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.3% (  1.0)   [kernel core] tpt_trig_timer (tpt_trig_timer)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.3% (  1.0)   ntpd
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                This is a significant reduction compared to the 100 CPU wakeups-from-idle +per second caused by Ruby 1.9.2-p290 running my wmiirc:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +Top causes for wakeups:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +26.8% (101.7)   chromium
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +26.4% (100.2)   ruby
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +12.3% ( 46.9)   [hda_intel] <interrupt>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 9.6% ( 36.3)   kworker/0:0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 6.3% ( 24.0)   [kernel scheduler] Load balancing tick
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 3.0% ( 11.5)   [ath9k] <interrupt>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 2.9% ( 11.0)   kworker/u:2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 2.8% ( 10.7)   SignalSender
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 2.4% (  9.1)   [kernel core] hrtimer_start (tick_sched_timer)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 1.3% (  5.0)   syndaemon
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 1.2% (  4.6)   [acpi] <interrupt>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 1.1% (  4.0)   [kernel core] usb_hcd_poll_rh_status (rh_timer_func)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.7% (  2.5)   wmii
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.6% (  2.1)   liferea
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.4% (  1.7)   X
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.3% (  1.2)   ario
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.3% (  1.0)   kworker/u:0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.3% (  1.0)   [kernel core] tpt_trig_timer (tpt_trig_timer)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 0.3% (  1.0)   ntpd
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                So leave your power cord behind and enjoy wmii +with Ruby today! :-)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/ruby-vpi-c-extension-breakthrough.html b/ruby-vpi-c-extension-breakthrough.html new file mode 100644 index 0000000..29f43df --- /dev/null +++ b/ruby-vpi-c-extension-breakthrough.html @@ -0,0 +1,30 @@ +Breakthrough in Ruby-VPI's C extension and Ruby 1.9 support - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Breakthrough in Ruby-VPI's C extension and Ruby 1.9 support

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Mikhail Ravkine suggested that regular development activity would stimulate +this community, so I thought I’d share some exciting news: for about a month +now, I’ve been working on adding support for Ruby 1.9, and this past weekend I +finally made a breakthrough.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Instead of running the Ruby interpreter (which in turn runs the executable +specification) inside a pthread and using pthread mutex to transfer control +between Ruby and Verilog, I would simply run the executable specification +inside a Ruby thread and use Ruby’s thread-safe Queue class (a mailbox) to +perform the control transfer.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                This approach has the advantage that we completely avoid the difficulties +associated with initializing the Ruby interpreter’s stack inside a pthread +(since a pthread’s stack is small compared to the main process).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Furthermore, since the Ruby interpreter is compiled with support for the +pthreads library on some systems, it becomes even more tricky to initialize +the interpreter’s stack correctly.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Nevertheless, this new approach works well with VCS, CVER, and NCSIM. +Unfortunately, it fails completely with VSIM reporting an internal +simulation kernel failure. This leading me to believe that VSIM invokes all +vlogstartuproutines somewhere outside the execution stack of the main +process (perhaps inside a pthread or within its own threading implementation).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Anyway, that’s the latest news about the C extension. There’s still some more +work to be done on the Ruby side of Ruby-VPI before Ruby 1.9 is fully +supported. I’m planning to work on that this weekend and make a release in the +middle of next week.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Cheers.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/ruby-vpi-using-ruby-debug.html b/ruby-vpi-using-ruby-debug.html new file mode 100644 index 0000000..4000bc0 --- /dev/null +++ b/ruby-vpi-using-ruby-debug.html @@ -0,0 +1,25 @@ +Using ruby-debug with ruby-vpi - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Using ruby-debug with ruby-vpi

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Here is one way to use ruby-debug +to help debug your ruby-vpi test benches. See the ruby-debug development +blog to learn more +ways.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Add the following code to the top of your bench.rb file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                require 'ruby-debug'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +Debugger.start
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Add the command debugger in your where you wish to start a debugging session.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Now you have a powerful and fast interactive Ruby debugger at your disposal. +The best part is that ruby-debug can be used remotely.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                As a result, we can start a ruby-debug server within a ruby-vpi bench and then +use a graphical tool for debugging. RadRails is already working towards such +a goal for +Ruby on Rails.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/ryuichi-sakamoto-solitude.html b/ryuichi-sakamoto-solitude.html new file mode 100644 index 0000000..ebd8bf5 --- /dev/null +++ b/ryuichi-sakamoto-solitude.html @@ -0,0 +1,17 @@ +Transcription of Ryuichi Sakamoto's "Solitude" - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Transcription of Ryuichi Sakamoto's "Solitude"

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                I finally spent some time to typeset my interpretation of Ryuichi +Sakamoto’s haunting melody called +Solitude, which he composed for the Japanese movie called Tony Takitani.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Enjoy!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/sencha-architect2-rails31-asset-pipeline.html b/sencha-architect2-rails31-asset-pipeline.html new file mode 100644 index 0000000..8606c91 --- /dev/null +++ b/sencha-architect2-rails31-asset-pipeline.html @@ -0,0 +1,128 @@ +Putting Sencha Architect 2 into Rails 3.1's asset pipeline - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Putting Sencha Architect 2 into Rails 3.1's asset pipeline

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. app/assets/javascripts/gui.rake
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    After months of building ExtJS +applications by hand, I decided to try a simpler, Visual Basic styled approach by using +Sencha Architect 2, wherein +I would design the Graphical User Interface (GUI) by drag-and-drop and +then add interactivity through appropriately-placed JavaScript snippets.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    In this article, I’ll show you how I put my ExtJS application (generated +by Sencha Architect 2) into my Rails 3.1 application’s asset pipeline. This procedure +should work equally well for handwritten ExtJS applications too!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    First, I created a gui/ directory inside my Rails application’s root +to house all of my Sencha Architect 2 project’s files like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • gui/ + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • app/ + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • controller/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • model/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • store/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • view/ + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • Application.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • Viewport.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • app.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • app.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • metadata/ + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • Application
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • controller/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • model/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • resource/ + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • Library
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • store/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • view/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • My_Sencha_Architect_2_Project.xds
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Second, I wrote a Rake script (see below) to compile the gui/ directory +into a single app/assets/javascripts/gui.js asset and ran it like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    cd app/assets/javascripts/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +rake -f gui.rake               # builds the asset as necessary
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +rake -f gui.rake clean default # forcefully rebuilds the asset
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Third, I placed the compiled app/assets/javascripts/gui.js asset into +my Rails application’s asset pipeline by adding the following line to my +app/assets/javascripts/application.js file:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    //= require gui
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    That’s all folks!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    app/assets/javascripts/gui.rake

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    This Rake script operates by assembling a dependency graph from requires +fields (which specify the names of other ExtJS classes that need to be +loaded beforehand in order to avoid dependency errors) that are present in +most ExtJS classes generated for the project by Sencha Architect 2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    It then flattens the dependency graph into a linear sequence, using the +Topological Sort +algorithm, in such a way that simply loading each ExtJS class in the +linear sequence, sequentially, will not trigger any dependency errors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    require 'rake/clean'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +require 'tsort'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +require 'yaml'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +task default: 'gui.js'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +CLEAN.include 'gui.js'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +directory project = '../../../gui'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +file 'gui' => project do |t|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  ln_s t.prerequisites.first, t.name
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +file 'gui.js' => FileList['gui', 'gui/app/**/*.js'] do |t|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  requires_by_file = RequiresHash.new
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  t.prerequisites.each do |file|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    if file.end_with? '.js' and File.read(file) =~ /\brequires:\s+(.+?)\s+\}/m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      requires_by_file[file] = Array(YAML.load($1)).map do |require|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +        "gui/app/#{require.split('.', 2).last.tr('.', '/')}.js"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  File.open(t.name, 'w') do |file|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    file.puts(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      '//= require_self',
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      requires_by_file.tsort.map {|r| "//= require ./#{r}" },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      '//= require_tree ./gui/app',
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      '//= require_tree ./gui',
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      # add a blank line to separate asset requires from inline logic
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      # that directly corresponds to the require_self directive above
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      nil,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      # prevent GUI logic from enabling ExtJS' dynamic asset loader since
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      # all necessary GUI assets are already present in this gui.js asset
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      'Ext.Loader.setConfig = function(){};'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    )
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +class RequiresHash < Hash
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  include TSort
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  alias tsort_each_node each_key
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  def tsort_each_child(node, &block)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    fetch(node, []).each(&block)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/slim-tilt-redcarpet.html b/slim-tilt-redcarpet.html new file mode 100644 index 0000000..dba235b --- /dev/null +++ b/slim-tilt-redcarpet.html @@ -0,0 +1,81 @@ +Using Redcarpet for Markdown in Slim - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Using Redcarpet for Markdown in Slim

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Example

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The Slim template language lets you embed Markdown sub-templates and +its underlying Tilt template processing engine lets you use your +favorite Markdown implementation in Ruby to process them.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I prefer the Redcarpet implementation of Markdown in Ruby because I have +personally worked with it before to convert Markdown documents into UNIX +manual pages.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Tilt assumes that Markdown implementations only accept one set of +configuration options, whereas Redcarpet accepts two of them:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Render options
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. Markdown extensions
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          When you tell Tilt to use Redcarpet for rendering Markdown, it only +passes your configuration options as Markdown extensions to Redcarpet. +Thus we have no standard way of passing render options to Redcarpet +through Tilt.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          We can work around this limitation by passing a pre-configured renderer +(which is already configured with our desired render options) as part of +the Markdown extensions for Redcarpet. For example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          renderer_class = Redcarpet::Render::HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +render_options = {} # TODO: fill this in!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +renderer = renderer_class.new(render_options)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Slim::Embedded.set_default_options :markdown => {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :renderer => renderer
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Example

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Here is a complete, working example to help you get started:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          require 'slim'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +require 'tilt'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +require 'redcarpet'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +renderer_class = Redcarpet::Render::HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +render_options = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  # https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :filter_html     => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :no_images       => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :no_links        => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :no_styles       => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :safe_links_only => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :with_toc_data   => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :hard_wrap       => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :xhtml           => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :prettify        => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :link_attributes => {},
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +renderer = renderer_class.new(render_options)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +markdown_extensions = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  # https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :no_intra_emphasis            => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :tables                       => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :fenced_code_blocks           => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :autolink                     => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :disable_indented_code_blocks => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :strikethrough                => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :lax_spacing                  => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :space_after_headers          => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :superscript                  => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :underline                    => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :highlight                    => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :quote                        => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :footnotes                    => false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  :renderer                     => renderer
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +# https://github.com/slim-template/slim/issues/245#issuecomment-8833818
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Slim::Embedded.set_default_options :markdown => markdown_extensions
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Tilt.register Tilt::RedcarpetTemplate::Redcarpet2, 'markdown', 'mkd', 'md'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Tilt.prefer Tilt::RedcarpetTemplate::Redcarpet2, 'markdown'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/socy15-essay1.html b/socy15-essay1.html new file mode 100644 index 0000000..7eda505 --- /dev/null +++ b/socy15-essay1.html @@ -0,0 +1,51 @@ +What is Globalization? - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          What is Globalization?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Although a form of social interaction (Held and McGrew, 2002:1) at heart, +Globalization is a socio-economic phenomenon which increasingly integrates the +world. Due to its breadth of control, it can cause a complex chain of effects: +social or economic problems in one country can spread to others; thus +entangling the world into a web of economic dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Globalization is often perceived as Westernization or Americanization due to +the imposition of Western culture upon the Global South as a result of +American business expansion. Many fear that American culture will hinder local +customs as “many of the most visible cultural expressions of globalization are +American – Coca-Cola, McDonald’s, CNN” (Giddens, 2000:33). Furthermore, they +identify that “global capitalism [is used] as a convenient cover for the +internationalization of American business above all else” (Held and McGrew, +2002:42).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Globalization “is associated with the deepening integration of separate +national economies” (Held and McGrew, 2002:39). This leads to the effects of a +socio-political event in one country to be felt in others. For example, a +political upheaval in Russia can cause layoffs in the Brazilian auto industry, +a recession in the United States can upset the Nikkei stock exchange, and an +incident like the “East Asian crash of 1997-8” can result in an economic +downturn in many countries (Held and McGrew, 2002:50).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Globalization has caused an increase in global economic inequality and the +survival rate in the world. A few countries are exempt from this observation: +namely Japan, and South Korea have caught up economically with the +industrialized West. These countries along with the Global North are extremely +rich compared to the Global South, mainly because they are industrialized and +can take advantage of Capitalism.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Globalization has also decreased the gap of survival between rich and poor, by +making medicines and health-care are relatively inexpensive as a result of +business competition and innovation. For example, the impoverished Indian +state of Kerala has one of the highest life expectancies “through public +outlays for education, health and nutrition” (Sen, 1993:22) while Saudi +Arabia, despite its wealth, has a lower life expectancy.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Globalization has been criticized as a tool for expanding the markets of +American business and spreading Western culture. It has combined together +disjoint economies such that events in one nation affect others. Moreover it +has increased economic inequality while increasing survival rate. +Globalization has shaped the world into a more tightly integrated and complex +socio-economic entity.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Held, D & McGrew, A. Globalization/Anti-Globalization. Cambridge, Polity.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            3. Giddens, A. Runaway world: How globalization is reshaping our lives. New York, Routledge.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            5. Sen, A. 1993. The Economics of Life and Death. Scientific American, 40-47.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/socy15-essay2.html b/socy15-essay2.html new file mode 100644 index 0000000..80c31c7 --- /dev/null +++ b/socy15-essay2.html @@ -0,0 +1,58 @@ +Chinese World Domination in the 19th Century - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Chinese World Domination in the 19th Century

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              China, during the Sung dynasty, was technologically centuries ahead of feudal +Europe and yet did not dominate the world by the 19th century. Scrutiny of +social values, government structure, and national objectives can help explain +why.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Technologically, China was far more advanced than Europe during the Sung +Dynasty. Paper and printing, advanced ship designs, gunpowder, the magnetic +compass, and the clock are some notable Chinese scientific innovations of this +era. Water and buffalo driven machines, as advanced as 18th century Europe, +powered China’s salt drilling industry (Nova, 1990). Zeng He, the great +Chinese explorer, owned a treasure fleet of 317 ships “the largest of which +were four hundred feet long (compared with eighty-five feet of Columbus’s +Santa Maria)” (Stokes, 2001:4). China’s centralized government promoted such +innovations, while Europe, strongly divided among quarreling nation-states, +could not.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Much of China’s technological progress was made possible by its social +structure which held scholars, civil servants, and even farmers socially above +merchants. The Chinese had an honor based society in which becoming a highly +educated civil servant to improve general welfare was more desirable than +making money. Even the sons of wealthy merchants would abandon their family +business and study to become civil servants (Nova, 1990). They were inspired +by ‘selfless officials’ such as the great scholar Li Bing and explorer Zeng +He. Li Bing devised a series of dams which prevented damage from seasonal +floods near Beijing (Nova, 1990). Zeng He made seven great voyages on the +Indian ocean as far as Madagascar (Stokes, 2001:5). In contrast, the +capitalist European society valued entrepreneurship over scholarship. Scarce +natural resources, capitalistic ideology, and the promise of abundant wealth +in Asia and slave trade in Africa, gave Europeans an incentive for +Imperialism.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              After the Ming dynasty arose, foreign exploration, astrological research, and +overseas exploration were strongly discouraged. For example, Zeng He’s massive +treasure fleet and the Chinese navy were disbanded and the ships were left to +rot (Nova, 1990). Instead, the Ming rulers attended to internal political +problems and promoting agriculture. For example, the Ming issued for the +extension of the Grand Canal from Hangdou to Beijing (Nova, 1990). This +inward-looking stance led to a “systematic resistance to learning from other +cultures” (Stokes, 2001:2) was China’s greatest handicap, argues Landes +(Stokes, 2001:2). In contrast, Europeans had the “ability to assimilate +knowledge from around the world and put it to use” (Stokes, 2001:2). This +handicap had isolated China from new technology and territorial expansion, as +Europe, without a central government to discourage exploration, began their +Imperialistic campaigns in the 19th century.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Differences in social values, government structure, and national objectives +can be used to explain why China did not dominate the world by 19th century. +However, it was mostly due to the decision of Ming rulers of halting foreign +affairs, exploration, and astrological research that China did not dominate +the world.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Stokes, G. (2001). “Why the West? The Unsettled Question of Europe’s Ascendancy.” Lingua Franca 11(8, November 2001): Cover story.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              3. Nova: The Genius That Was China, 1990. Video. USA: Nova.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/socy15-essay3.html b/socy15-essay3.html new file mode 100644 index 0000000..10fb042 --- /dev/null +++ b/socy15-essay3.html @@ -0,0 +1,50 @@ +Changes in Womens' roles due to Industrialization in Northern Europe - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Changes in Womens' roles due to Industrialization in Northern Europe

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                In Northwest Europe, Industrialization had brought about restrictions in +Women’s roles as people moved from traditional farming societies to big +industrial cities. Women in wealthy families were more so bound to their +homes, while those in poor families worked long hours for minuscule wages in +the emerging Victorian society.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                As industrialization emerged, men went to work in factories while women were +left behind to perform domestic work. This separation of work and home reduced +the economic importance of women at home, as they “no longer learned craft and +productive skills from their fathers and husbands” (Bradley, 1996:127). Women +in poor families were economically forced to work outside the home. Many of +whom worked as Governesses, which was “ill-paid and commanded little social +respect” (Bradley, 1996:140), and “ended up as paupers or dependent on +charity” (Bradley, 1996:140). For example, “In 1851 there were over a million +women servants” (Bradley, 1996:134). In contrast, women from wealthy families +were only allowed to perform “unpaid charitable work, visiting the sick, and +improving the lives and morals of their working class sisters” (Bradley, +1996:140) under the male-dominated Victorian society.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Job opportunities for women were shortened by sexual division of labor, as +industrial employers would give them “women’s work” that consisted of +“repetitive and unskilled” tasks (Bradley, 1996:141). In addition to a narrow +choice of work, women faced horrible working conditions and long hours for +miniscule wages. In pre-industrial economy, “spinning was a major female +occupation while weaving was a traditional male skill” (Bradley, 1996:141). +However, the use of machines during the Industrial era took the role of +spinning, and women were now assigned the role of weaving (Bradley, 1996:141).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The imposition of stereotyped gender roles by Victorian society had +established strong patriarchy in Northwest Europe. Women were becoming more +powerless as they received extremely low pay for their work and became +dependent on men (Bradley, 1996:140). Bradley notes “Sex segregation of jobs +became a major vehicle for the continuing social dominance of men” (Bradley, +1996:142). Through the use of sexual stereotypes such as women’s “intellect is +not for invention or creation, but for a sweet ordering, arrangement and +decision” (Bradley, 1996:140), Victorian society had essentially segregated +women from economic freedom and bound them into a strongly male-dominated +society.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Prior to industrialization women were more valued as they were an important +contributor to family income. With the coming of Industrialization and +establishment of Victorian ideology, women were restricted to domestic work by +discrimination and poor wages in the workplace.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Bradley, H (1996) Changing Social Structures: Class and Gender, Chapter 4 in Hall, S., et al (1995). Modernity: an introduction to modern societies. Blackwell.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/soundblaster-audigy-2-value-in-ubuntu-hoary.html b/soundblaster-audigy-2-value-in-ubuntu-hoary.html new file mode 100644 index 0000000..21eea52 --- /dev/null +++ b/soundblaster-audigy-2-value-in-ubuntu-hoary.html @@ -0,0 +1,92 @@ +SoundBlaster Audigy 2 Value and Ubuntu Hoary - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                SoundBlaster Audigy 2 Value and Ubuntu Hoary

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      After a day of web searching and frantically asking for help in #ubuntu +IRC channel, I have succeeded! Now I will share with you my secret so that +you too may enjoy the rich sounds of the SoundBlaster Audigy 2 Value +sound card in Ubuntu Hoary. This should also work for the SoundBlaster +Audigy 2 LS sound card according to some websites, but I have not tested +it myself.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      The default 2.6.10-5 kernel, which comes with Ubuntu Hoary, has an outdated +ALSA 1.0.6 module which does not support the Audigy 2 LS or the Audigy 2 Value +sound cards.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Replace the kernel’s ALSA 1.0.6 module with the newer ALSA 1.0.8 module, +because the latter has support for Audigy 2 sound cards. We do this by +downloading the latest ALSA source package, recompiling the module, and +installing it onto the kernel.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Install the necessary packages:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        sudo apt-get install module-assistant build-essential linux-headers-$(uname -r) alsa-source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      3. Launch the module assistant program:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        sudo module-assistant
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Choose “Select” from the menu.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3. Choose “alsa” from the list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      5. Choose “No” for adding ISA PnP support.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      7. Choose “No” for adding debugging support, unless you are an able ALSA +hacker.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Choose “Get” from the menu.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3. Choose “Build” from the menu.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        5. Choose “Yes” when asked if you want to install the newly built +module.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        7. Choose “Exit” from the menu.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      9. Load the newly built and installed ALSA module into the kernel:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        modprobe snd-ca0106
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      11. Verify that the kernel now has the correct version (1.0.8) of the ALSA module:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        cat /proc/asound/version
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      13. Instruct the system to always load the new ALSA module into the +kernel whenever it boots:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        sudo echo snd-ca0106 >> /etc/modules
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      15. Reboot your computer:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        sudo reboot
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      16. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      17. Verify that the system has detected your Audigy sound card:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        cat /proc/asound/cards
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Make a note of the number at the beginning of the line which +describes your Audigy sound card. I will refer to this number as +CARDID_ from now on.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      18. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      19. Enable the audio output of your Audigy sound card:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        alsamixer -c CARD_ID
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Press the right arrow key until you see the following near the +top of the screen:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Item: Audigy Analog/Digital Output Jack [Off]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3. Press the M key and verify that you now see the following near +the top of the screen:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Item: Audigy Analog/Digital Output Jack
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        5. Press the escape key to exit the program.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      20. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      21. Now you should be able to play some audio and hear the output on your +speakers. Instruct the system to remember the alsamixer settings:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        sudo alsactl store
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      22. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      \ No newline at end of file diff --git a/startx-login-tty1.html b/startx-login-tty1.html new file mode 100644 index 0000000..0de748c --- /dev/null +++ b/startx-login-tty1.html @@ -0,0 +1,36 @@ +Automatically starting X after logging into a Linux virtual terminal - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Automatically starting X after logging into a Linux virtual terminal

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. References
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            After logging into a Linux virtual terminal, running startx to launch your +graphical desktop session leaves the virtual terminal open to keyboard input. +Anyone can switch back to the virtual terminal where you logged in (using +the Control+Alt+Fn keys) and then suspend (with Control+Z), interrupt (with +Control+C), or even terminate (with Control+4) your startx process along +with the graphical desktop session it powers. Doing so, they gain access to +the underlying shell that ran startx and thus assume your identity on +your system and then it’s game over, you lose! :-(

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Have startx take over the Linux virtual terminal from which it was launched, +thereby protecting the underlying shell from keyboard input, by setting the +XDG_VTNR environment variable to the number of that Linux virtual terminal:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            env XDG_VTNR=$( tty | tr -dc 0-9 ) startx
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Next, instead of manually running the above command every time you log in, you +can automate it just on the first Linux virtual terminal (because sometimes +you just need direct access to the shell and not the full-blown graphical +desktop environment) by adding the following snippet to your ~/.profile +shell startup file:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            # start X when logging into first virtual terminal
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# see /etc/X11/xinit/xserverrc for $XDG_VTNR trick
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +test -z "$DISPLAY" -a "$(tty)" = /dev/tty1 &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +exec env XDG_VTNR=1 startx > ~/.xsession-errors 2>&1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            References

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • /etc/X11/xinit/xserverrc taught me about the $XDG_VTNR trick.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..8b8426a --- /dev/null +++ b/style.css @@ -0,0 +1,415 @@ +@charset "UTF-8"; +@import url("https://fonts.googleapis.com/css2?family=Recursive:CASL,MONO@1,1&display=swap"); +body, pre, code { + font-family: "Recursive", monospace; } + +@media screen { + body { + font-size: 1.618en; + line-height: 1.618em; + color: #d3c6aa; + background-color: #323d43; + text-shadow: 0 0 1ch black, 0 0 1ex, 0 0 1em black; } + + ::selection { + background-color: #3d5665 !important; } + + article#body { + margin: auto; + max-width: 80ch; + text-align: justify; } + article#body > hr { + visibility: hidden; } + article#body > header, article#body > footer { + text-align: center; } + article#body > header { + margin-bottom: 2em; } + article#body > header > .navigation { + margin: 1em; + font-size: 2.617924em; } + article#body > header > .navigation > a { + margin: 0.25em; + text-decoration: none; + border-bottom: none; } + article#body > header > .navigation > a:not([href]) { + visibility: hidden; } + article#body > header > .navigation > a.rootlink > span { + display: none; } + article#body > header > .title > a.feed > img { + display: inline; } + article#body > header > .author, article#body > header .date { + font-size: smaller; } + article#body > header > .description a img { + display: initial; } + article#body > header > .date:not(:last-child) { + text-decoration: line-through; } + article#body > header > .date:not(:last-child) + br { + display: none; } + article#body > header > .date:not(:last-child) + br + .date { + display: block; + position: relative; + top: -1ch; } + article#body > header > .date > .update_count { + font-size: larger; + font-weight: bolder; } + article#body > footer { + font-size: smaller; } + article#body .category, article#body .credits { + color: #9da9a0; } + article#body > .content .table-of-contents { + box-shadow: inset 0 0 1.618ex #3d5665; + padding: 1.5em; + padding-left: 3em; + padding-right: 0; + margin-bottom: 2em; } + article#body > .content .section { + margin-top: 2.617924em; } + article#body > .content .heading { + position: sticky; + top: 0; + margin-top: 0; + background-color: #323d43; + font-size: x-large; + z-index: 1; } + article#body > .content img, article#body > .content video, article#body > .content audio, article#body > .content embed, article#body > .content iframe { + box-shadow: 0 0 1.618ex #9da9a0; + margin-top: 1.618ex; + margin-bottom: 1.618ex; } + article#body > nav.entries > ul > li { + margin-top: 1em; } + article#body > nav.entries > ul > li:target > .title > a { + color: #f8f0dc; + font-weight: bolder; + text-decoration: none; + border-bottom: none !important; } + article#body > nav.entries > ul > li:target > .title > a:before { + content: "💁"; } + article#body > nav.entries > ul > li > .title > a { + margin-left: 0px; } + article#body p + p { + text-indent: 4ch; } + + h1, h2, h3, h4, h5, h6, th { + color: #a7c080; + line-height: 1.618em; } + + hr { + border-color: #3d5665; } + + img, video, audio, embed, iframe { + margin: auto; + display: block; + max-width: 100%; + max-height: 100%; } + + img[height] { + height: auto; } + + blockquote { + color: #9da9a0; + font-style: italic; + text-align: center; } + blockquote blockquote { + font-style: initial; + text-align: justify; } + blockquote pre { + font-style: initial; + text-align: initial; + display: inline-block; } + blockquote div.highlight { + background-color: inherit; } + blockquote .heading { + margin-left: -2em; + padding-left: 2em; } + + dt, strong, em, b, i, u { + color: #dbbc7f; } + + code { + color: #83c092; + font-weight: bolder; } + + pre { + box-shadow: inset 0 0 1.618ex #3d5665; + padding: 1.618em; + line-height: initial; + font-size: smaller; } + pre code { + color: inherit; + font-weight: inherit; + font-size: larger; } + pre code span.c, pre code span.c1, pre code span.cm { + font-style: inherit !important; + color: #dbbc7f !important; } + + ol > li { + list-style-type: decimal; } + ol > li ol > li { + list-style-type: lower-alpha; } + ol > li ol > li ol > li { + list-style-type: lower-roman; } + ol > li ol > li ol > li ol > li { + list-style-type: upper-alpha; } + ol > li ol > li ol > li ol > li ol > li { + list-style-type: upper-roman; } + ol > li ol > li ol > li ol > li ol > li ol > li { + list-style-type: lower-greek; } + + table { + margin: auto; + border-collapse: collapse; } + table tr { + border-bottom: thin solid #3d5665; } + table tr th, table tr td { + margin: initial; + padding: 0.5em; + text-align: center; } + + a img { + border: none; } + a:not([href*='://']) { + text-decoration: none; + border-bottom: thin dashed; } + a[href^='#'] { + border-bottom-style: dotted; } + a:link { + color: #7fbbb3; } + a:visited { + color: #d699b6; } + a:hover { + color: #f8f0dc; } + a.rootlink, a.prevlink, a.nextlink, a.downlink, a.permalink, a.uplink { + text-decoration: none; + border-bottom: none !important; + margin-left: 0.5ex; } + a.rootlink:before { + content: "🗺"; } + a.prevlink:before { + content: "👈"; } + a.nextlink:after { + content: "👉"; } + a.downlink:before { + margin-right: 0.5ex; } + a.downlink:target { + color: #f8f0dc; + font-weight: bolder; + text-decoration: none; + border-bottom: none !important; } + a.downlink:target:before { + content: "💁"; } + a.permalink:before { + content: "🙋"; } + + div.section:target + .heading > a.permalink { + color: #f8f0dc; + font-weight: bolder; + text-decoration: none; + border-bottom: none !important; } + div.section:target + .heading > a.permalink:before { + content: "💁"; } + div.section:target + .heading > a.uplink:before { + content: "🗺"; } + + a.embed_youtube_video { + border-bottom: none; + text-decoration: none; } + a.embed_youtube_video > img { + width: 480px; + height: 360px; } + a.embed_youtube_video:before { + content: "▶"; + font-size: 96px; + font-style: normal; + text-shadow: 0 0 30px yellow; + -webkit-text-stroke: 2px black; + position: absolute; + margin-top: 152px; + margin-left: -32px; + text-indent: 0; } } +@media print { + article#body header { + text-align: center; } + article#body hr, article#body .navigation, article#body a.uplink, article#body a.permalink, article#body .comments, article#body footer { + display: none; } + + a { + text-decoration: none; } + a[href]:not([href^='#']):after { + content: " " attr(href) " "; + font-family: monospace; } } +.highlight table td { padding: 5px; } +.highlight table pre { margin: 0; } +.highlight { + color: #faf6e4; + background-color: #122b3b; +} +.highlight .gl { + color: #dee5e7; + background-color: #4e5d62; +} +.highlight .gp { + color: #a8e1fe; + font-weight: bold; +} +.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs { + color: #6c8b9f; + font-style: italic; +} +.highlight .cp { + color: #b2fd6d; + font-weight: bold; +} +.highlight .err { + color: #fefeec; + background-color: #cc0000; +} +.highlight .gr { + color: #cc0000; + font-weight: bold; + font-style: italic; +} +.highlight .k, .highlight .kd, .highlight .kv { + color: #f6dd62; + font-weight: bold; +} +.highlight .o, .highlight .ow { + color: #4df4ff; + font-weight: bold; +} +.highlight .p, .highlight .pi { + color: #4df4ff; +} +.highlight .gd { + color: #cc0000; +} +.highlight .gi { + color: #b2fd6d; +} +.highlight .ge { + font-style: italic; +} +.highlight .gs { + font-weight: bold; +} +.highlight .gt { + color: #dee5e7; + background-color: #4e5d62; +} +.highlight .kc { + color: #f696db; + font-weight: bold; +} +.highlight .kn { + color: #ffb000; + font-weight: bold; +} +.highlight .kp { + color: #ffb000; + font-weight: bold; +} +.highlight .kr { + color: #ffb000; + font-weight: bold; +} +.highlight .gh { + color: #ffb000; + font-weight: bold; +} +.highlight .gu { + color: #ffb000; + font-weight: bold; +} +.highlight .kt { + color: #b2fd6d; + font-weight: bold; +} +.highlight .no { + color: #b2fd6d; + font-weight: bold; +} +.highlight .nc { + color: #b2fd6d; + font-weight: bold; +} +.highlight .nd { + color: #b2fd6d; + font-weight: bold; +} +.highlight .nn { + color: #b2fd6d; + font-weight: bold; +} +.highlight .bp { + color: #b2fd6d; + font-weight: bold; +} +.highlight .ne { + color: #b2fd6d; + font-weight: bold; +} +.highlight .nl { + color: #ffb000; + font-weight: bold; +} +.highlight .nt { + color: #ffb000; + font-weight: bold; +} +.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx { + color: #f696db; + font-weight: bold; +} +.highlight .ld { + color: #f696db; + font-weight: bold; +} +.highlight .ss { + color: #f696db; + font-weight: bold; +} +.highlight .s, .highlight .sb, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .sr, .highlight .s1 { + color: #fff0a6; + font-weight: bold; +} +.highlight .sa { + color: #f6dd62; + font-weight: bold; +} +.highlight .se { + color: #4df4ff; + font-weight: bold; +} +.highlight .sc { + color: #4df4ff; + font-weight: bold; +} +.highlight .si { + color: #4df4ff; + font-weight: bold; +} +.highlight .nb { + font-weight: bold; +} +.highlight .ni { + color: #999999; + font-weight: bold; +} +.highlight .w { + color: #BBBBBB; +} +.highlight .go { + color: #BBBBBB; +} +.highlight .nf, .highlight .fm { + color: #a8e1fe; +} +.highlight .py { + color: #a8e1fe; +} +.highlight .na { + color: #a8e1fe; +} +.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm { + color: #a8e1fe; + font-weight: bold; +} \ No newline at end of file diff --git a/switching-from-fish-to-zsh.html b/switching-from-fish-to-zsh.html new file mode 100644 index 0000000..b0656d6 --- /dev/null +++ b/switching-from-fish-to-zsh.html @@ -0,0 +1,61 @@ +Switching from Fish to ZSH - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Switching from Fish to ZSH

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            I recently migrated from Fish to ZSH using the excellent oh-my-zsh as the base configuration, +plus my contributed fishy theme (shown below) for a Fish-like prompt +with Git integration, and the zsh-syntax-highlighting plugin for +Fish-like syntax highlighting of the command line.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            My "fishy" theme for oh-my-zsh. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ZSH worked well, but I dearly missed Fish’s ubiquitous up-arrow history +search, which was the main feature that made Fish so productive for me: +type any part of any command that you had entered in the past and press +the up arrow key until you happen upon a suitable match. Indispensable!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Before succumbing to my overwhelming desire to implement this feature in +ZSH and release it to the world as an open source project on GitHub, I +briefly searched for existing solutions and found a past attempt by Peter +Stephenson on the ZSH +mailing list back in September 2009. However, I was unable to install it +properly into my ZSH configuration at the time.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            I was fiddling with the installation again yesterday when Guido van Steen +announced on the fish-users mailing list that he had revised Stephenson’s +implementation and released it as part of fizsh (Friendly Interactive +ZSH). Although I was slightly +disappointed that someone beat me to it, I could not help but marvel at +the collaborative power of the Internet and Open Source! We truly live in +amazing times.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            I downloaded the fizsh tarball, extracted the +etc/fizsh/fizsh-history-search-backward file into my +~/.oh-my-zsh/functions/ directory, and copied the following activation +logic from the extracted etc/fizsh/fizshrc file to the bottom of my +~/.zshrc file:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            autoload -U fizsh-history-search-backward
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +zle -N fizsh-history-search-forward fizsh-history-search-backward
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +zle -N fizsh-history-search-backward
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +bindkey '\e[A' fizsh-history-search-backward
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +bindkey '\e[B' fizsh-history-search-forward
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            I must say that I’m very pleased with the results so far: I now have +Fish’s ubiquitous up-arrow history search feature natively in ZSH! And +with this, I can finally say goodbye to the Fish shell without regret: so +long, old pal, and thanks for all the fish! ;-)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/switching-from-jedit-to-vim.html b/switching-from-jedit-to-vim.html new file mode 100644 index 0000000..4263eef --- /dev/null +++ b/switching-from-jedit-to-vim.html @@ -0,0 +1,28 @@ +Switching from jEdit to Vim - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Switching from jEdit to Vim

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            After nearly nine years of using jEdit as my primary text +editor, I have switched to Vim because of its lower +computational requirements, its ability to function in a text-only environment +(256-color terminals and terminal +multiplexers for the win!), and its +efficient modal approach to text entry, navigation, and manipulation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            But what really spurred this sudden change? It was an inferior CPU.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            I bought an NVIDIA ION system with the Intel Atom N330 +processor last year and built a +silent, low-power desktop (33 Watts total!) that could still play HD movies. +I don’t play computer games anymore so this was sufficient for my programming +needs, or so I thought…

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Unfortunately, this new system was sickeningly underpowered (CPU wise) as +jEdit literally began to crawl. It would lag when displaying text that I had +typed on the screen, and would pause momentarily before scrolling the text +buffer to the next or previous page. This was clearly unacceptable!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Luckily, I was reasonably comfortable with Vim because I had been using it to +make quick edits (whenever I was in a terminal) for the past six years. So +this time, I decided to seriously learn it, once and for all.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            After a few days of self-reprogramming, I had a heavily customized +Vim with easier jEdit-like shortcuts and the +ability to install Vim plugins neatly. I had completely switched to Vim.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Now I truly am a terminal dwelling, modal editing Linux geek! :-]

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/tamsyn-1.7b-font-review.html b/tamsyn-1.7b-font-review.html new file mode 100644 index 0000000..4e2a655 --- /dev/null +++ b/tamsyn-1.7b-font-review.html @@ -0,0 +1,63 @@ +Tamsyn 1.7b programming font review - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Tamsyn 1.7b programming font review

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            NOTE: I’ve published my changes to this font as a new Tamzen font.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Tamsyn is the crispest monospace font I’ve ever seen — it doesn’t even need +antialiasing! A new 1.7b version was released yesterday with tweaks to existing +ASCII characters along with new additions to the Extended Latin characters set.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Tamsyn8x17r.bdf +Tamsyn8x17b.bdf +Tamsyn8x15r.bdf +Tamsyn8x15b.bdf +Tamsyn7x14r.bdf +Tamsyn7x14b.bdf +Tamsyn7x14r.bdf +Tamsyn7x14b.bdf +Tamsyn6x11r.bdf +Tamsyn6x11b.bdf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            I like the following changes to the ASCII characters set in the new version:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • NUL - drawn as empty square; useful for programming
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • 1 - underscore below makes it easier to recognize
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • S - more streamlined and similar to lowercase s
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • C, G, O, and Q - more roundness, hurray!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            However, I dislike the following changes because they detract from the distinct +styling of Tamsyn; particularly the uniform roundness of its characters:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • l - roundness is gone; it reminds me of Courier :(
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • y - less round; too different from the round g
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • w - roundness is gone; too sharp and jagged
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Though I’m neutral about the following changes and will give them a chance:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • t - small loss of roundness and more centered now
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • f - less round and the horizontal stroke is higher
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • j - less round in the descender stroke
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/tamsyn-1.7b-review.html b/tamsyn-1.7b-review.html new file mode 100644 index 0000000..573ad75 --- /dev/null +++ b/tamsyn-1.7b-review.html @@ -0,0 +1 @@ + diff --git a/telugu-fonts-in-ubuntu-breezy.html b/telugu-fonts-in-ubuntu-breezy.html new file mode 100644 index 0000000..ad7df19 --- /dev/null +++ b/telugu-fonts-in-ubuntu-breezy.html @@ -0,0 +1,11 @@ +Proper rendering of Indic fonts in Ubuntu Breezy - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Proper rendering of Indic fonts in Ubuntu Breezy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Thanks to Soumyadip Modak in the IndLinux mailing list, I finally learned how +to enable proper rendering of Indic fonts in Ubuntu. Now I can +read Telugu text on the Web like I used to with Fedora Core 2, 3, and 4.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The problem was that some low quality Indic fonts in the ttf-freefont +package were being used by Pango to render Indic text. So, remove the ttf- +freefont package and you’re back in business!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/telugu-rts-with-iiimf.html b/telugu-rts-with-iiimf.html new file mode 100644 index 0000000..e98fb91 --- /dev/null +++ b/telugu-rts-with-iiimf.html @@ -0,0 +1,175 @@ +Telugu RTS with IIIMF - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Telugu RTS with IIIMF

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +The RTS code-table in action. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Please note that future development of this work (including Telugu RTS for +SCIM) can be found at the Swecha localization project’s wiki and also at Wikipedia. Also, this article was originally written during the fall of 2004.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Motivation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Screenshots
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Files
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Resources
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  2. Installation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Path to the UNIT LE
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Path to fonts
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Installation procedure
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. Common problems and solutions
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Enable languages in the UNIT LE
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Enable proper Indic font-rendering in Mozilla
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Kickstart the UNIT LE

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Motivation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              For several months, I had been using the Yudit +program’s Roman-to-Indic transliteration engine, which is based upon the +Rice Transliteration Standard (RTS) for writing text in Telugu. I often wondered, “Wouldn’t it be great if +such functionality existed in all programs?”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Luckily, I soon found out about the existence of exactly such capability, +via the Internet Intranet Input Method Framework (IIIMF) Unicode Table (UNIT) +Language Engine (LE), from the Fedora Core release notes. Whilst investigating the +IIIMF website, I found some screenshots and was immediately impressed!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              However, when I went to try out the IIIMF UNIT LE in person, I was +disappointed to find that the existing Telugu IIIMF code-table merely re- +mapped the keyboard according to the INSCRIPT specification. Frustrated and empowered to add transliteration support +for Telugu, I adapted the RTS key-map from Yudit into a code-table usable +by the IIIMF. I have submitted the +code-table to the IIIMF UNIT LE group where it is currently under review.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Screenshots

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Files

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Resources

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Installation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The following instructions pertain mostly to the Fedora Core GNU/Linux +distribution. However, the process should be quite similar on all GNU/Linux +distributions.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Before we get started, install the necessary IIIMF packages as the super user +(root):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              yum install 'iiimf**'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Path to the UNIT LE

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The $UNIT variable will be used to keep track of the path to your UNIT LE +installation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • If you are using Fedora Core 3, then execute:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                UNIT=/usr/lib/im/locale/UNIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • If you are using Fedora Core 4, then execute:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                UNIT=/usr/lib/iiim/le/unitle
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • If you are using a different GNU/Linux distribution and know where your +UNIT LE installation resides, simply point the $UNIT variable to the +path of your UNIT LE installation. Otherwise, try execute the following +and see if it uncovers the path to your UNIT LE installation:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                find /usr -name txt2bin -type f -print 2>/dev/null | sed 's/common.**$//'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Path to fonts

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The $FONT variable will be used to keep track of the path to your X +server’s fonts directory.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • If you want to install fonts globally and are using Fedora Core 3 or 4, +then execute:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                FONT=/usr/lib/X11/fonts/indic
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • If you want to install fonts to your home directory, then execute:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                FONT=~/.fonts
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Installation procedure

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Download the Indic fonts and +extract them into $FONT. Note that you do not need to be logged-in as +root for this part if you are installing fonts into your home +directory.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                mkdir $FONT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +tar -vzxf indic-otf-0.2.tar.gz
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +cp -iv indic/OpenType/**ttf $FONT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +mkfontscale $FONT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +mkfontdir $FONT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              3. Download the Telugu RTS code-table +and convert it into a binary format using the txt2bin utility:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                $UNIT/common/txt2bin telugu_rts.utf telugu_rts.data
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              5. As the super user (root), copy the binary code-table file into the +IIIMF UNIT locale directory:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                cp telugu_rts.data $UNIT/TELUGU/data/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              7. As the super user (root), edit the $UNIT/sysime.cfg file so that +its “[ te_IN ]” section appears like the following.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [ te_IN ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +telugu_rts common/ctim.so TELUGU
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +inscript common/ctim.so TELUGU
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              9. As the super user (root), restart the IIIMF server:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /sbin/service iiim restart
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              11. Exit out of your graphical desktop environment if any are currently +running.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              13. Restart the X server by pressing the Control, Alt, and +Backspace keys simultaneously, or by executing the following +command as the super user (root):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /sbin/telinit 3 && /sbin/telinit 5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Common problems and solutions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Enable languages in the UNIT LE

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              If you see no languages or only some languages listed in the “Add or +Remove languages” window of the GIMLET client program, then the following +will be of interest to you.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              As noted in Fedora’s IIIMF FAQ, if you use a +locale that is not associated with a certain language, and want to use +IIIMF to write in that language, then run the following commands and +restart the X server (see instructions above).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              mkdir ~/.xinput.d
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +ln -s /etc/X11/xinit/xinput.d/iiimf ~/.xinput.d/default
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Now you should be able to write in any language, regardless of which locale +you are currently using.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Enable proper Indic font-rendering in Mozilla

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              As stated in the Fedora Core 3 release notes, you can enable the +beautiful rendering of indic fonts in Mozilla by setting the following +environment variable before running it, or by placing the following in +your shell’s resource file (in my case, this file is ~/.bashrc because I +use the GNU BASH shell):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              export MOZ_ENABLE_PANGO=1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Kickstart the UNIT LE

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In Fedora Core 3, the GIMLET client sometimes fails to enable the language +in which I want to write in. The following crude procedure (alike whacking +an old television set on its side when its picture is distorted) seems to +make it work again, most of the time.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              As root, I repeatedly jump-start the IIIMF server until it reports that it +has succeeded in disabling and re-enabling itself:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              # service iiim restart
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +Stopping IIIMF input server:  [  OK  ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +Starting IIIMF input server:  [  OK  ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/telugu-rts-with-scim-demo.html b/telugu-rts-with-scim-demo.html new file mode 100644 index 0000000..9fe3525 --- /dev/null +++ b/telugu-rts-with-scim-demo.html @@ -0,0 +1,17 @@ +Video demonstration of Telugu RTS with SCIM - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Video demonstration of Telugu RTS with SCIM

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              For a while now, I had been wanting to take a video screen-capture of my +Telugu RTS input method for SCIM in action. Luckily, I happened upon this +Screen Casting page on +the Fedora Core wiki, and learned about two cool programs which take video +screen- captures.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The first is Istanbul which outputs a +video in Ogg Theora format, and the second is Byzanz which outputs +a video in animated GIF format. I chose the latter because all graphical +browsers should be able to display it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +Telugu RTS with SCIM in Ubuntu Breezy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Without further adieu, here is the video demonstration of Telugu RTS with +SCIM on my Ubuntu (Breezy Badger) system. You can set this up on your own +computer by following the instructions in this related article.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/telugu-rts-with-scim.html b/telugu-rts-with-scim.html new file mode 100644 index 0000000..432ed34 --- /dev/null +++ b/telugu-rts-with-scim.html @@ -0,0 +1,75 @@ +Telugu RTS with SCIM - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Telugu RTS with SCIM

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Features
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Sunna generation inside a word
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Sunna generation at the end of a word
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Preventing sunna generation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    2. Requirements
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Installation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        I am happy to announce that an implementation of the Telugu RTS +transliteration scheme is now available for SCIM! Special thanks to Mr. Naoto TAKAHASHI of +m17n-lib, who kindly implemented its +state machine.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +Telugu RTS with SCIM in Ubuntu Breezy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Please try out this transliteration scheme (see instructions below) and +notify me about any problems. Also, see this related article about the demonstration video above.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Features

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        In addition to the functionality expected from its elder sibling, Telugu +RTS for IIIMF, this one features automatic +sunna generation inside a word and, when possbile, at the end of a word.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Sunna generation inside a word

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Usually you would type ‘gaaMdhi’ to generate ‘గాంధి’, but now you can type +more naturally: both ‘gaandhi’ and ‘gaamdhi’ generate ‘గాంధి’.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Sunna generation at the end of a word

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Instead of typing ‘chakraM’ to generate ‘చక్రం’, you can type more naturally: +‘chakram’ to generate the same thing.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Preventing sunna generation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        As specified in the RTS, you can manually override this automatic sunna +generation by typing an ampersand (&) after an ‘n’ or ‘m’ character.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        For example, ‘vandE’ and ‘vamdE’ yield ‘వందే’, whereas ‘van&dE’ and ‘vam&dE’ +yield ‘వన్దే’. Similarly ‘padyam’ yields ‘పద్యం’, whereas ‘padyam&’ yields +‘పద్యమ్’.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Note that sunna is not generated if a word ends with an ‘n’. So, ending a +word with ‘n’ and ‘n&’ yields the same result.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Requirements

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Get from m17n-lib:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • m17n-lib 1.3.1 or newer
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • m17n-db 1.3.1 or newer
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Get from SCIM:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • scim 1.0.2-3 or newer
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • scim-m17n 1.0.2-3 or newer
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • scim-gtk2-immodule 1.0.2-3 or newer
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Installation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        For the time being, download the state machine from here.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The m17n-lib developers are planning to create a m17n-contrib package in +which they will accept user contributed state machines. I plan to submit +this state machine, such that it will be included with the core m17n-lib +distribution in the future.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. As root, copy the te-rts.mim file into /usr/share/m17n/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3. As yourself, kill any existing SCIM processes:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ps aux | grep scim | awk '{print $2}' | xargs kill
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        5. Start SCIM:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          export XMODIFIERS='@im=SCIM'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +export GTK_IM_MODULE=scim
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +export QT_IM_MODULE=scim
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +scim -d &
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        7. Launch any GTK2 program, such as gedit, and press Control+Space.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        9. Choose “Telugu > M17N-te-rts” from the gtk2-immodule applet.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        11. Start typing Telugu text using the RTS transliteration scheme!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        \ No newline at end of file diff --git a/telugu-vocabulary.html b/telugu-vocabulary.html new file mode 100644 index 0000000..911c21a --- /dev/null +++ b/telugu-vocabulary.html @@ -0,0 +1,486 @@ +Telugu vocabulary for modern Telugu people - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Telugu vocabulary for modern Telugu people

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +World Telugu Conference postage stamp +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        దేశభాషలందు తెలుగు లెస్స. +ఎందరో మహానుభావులు అందరికీ వందనములు. +పంచదారకన్న పనసతొనలకన్న కమ్మని తేనెకన్న తెలుగు మిన్న.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        dESabhAshalandu telugu lessa. +endarO mahAnubhAvulu andarikI vandanamulu. +panchadArakanna panasatonalakanna kammani tEnekanna telugu minna.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Notes on usage
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Common vocabulary

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Since the mid 1800s, knowledge of English and emulation of Western culture +has been intentionally sought by mainstream Telugu people at the expense +of their own cultural identity. In fact, they have sought to such an +extent that today, we speak a kind of Telugu that predominantly consists +of English!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            In hopes of withstanding the pressures of popular society, which blindly +endorses this trend, I have sought lingual freedom through education. +Thus, I invite you to walk alongside me on this path, so that one day we +may speak and write purely and effluently in Telugu.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Notes on usage

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • For what seems to affect all words, the “ము” (mu) suffix undergoes a +modern simplification whereby an anvusvara “ం” (am) is substituted in +its place. For example, compare the word “చక్రము” (chakramu) with its +modern simplification of “చక్రం” (chakram).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Many words prefixed with a రా వత్తు (raa vattu) undergo a modern +simplification whereby the రా వత్తు is discarded. For example, compare +the word “క్రింద” (krinda) with its modern simplification of “కింద” +(kinda). Perhaps this is more prevalent in speech than in writing.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Common vocabulary

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            EnglishTeluguTransliteration
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            actual (real)వాస్తవమైన, యథార్థమైన, అసలైనvaastavamaina, yathaarthamaina, asalaina
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            actual (true)తథ్యమైన, నిజమైనtathyamaina, nijamaina
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            addressచిరునామముchirunaamamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            aim, purposeఉద్దేశము, అభిప్రాయముuddaeSamu, abhipraayamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            animalజంతువుjaMtuvu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            answerసమాధానముsamaadhaanamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            approximatelyరమారమిramaarami
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            articleవ్యాసముvyaasamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            becoming stuckచిక్కుకొనుటchikkukonuTa
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            behaviorప్రవర్తనpravartana
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            birdపక్షిpakshi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            bridgeవారధి, వంతెన, సేతువుvaaradhi, vaMtena, saetuvu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            brightప్రకాశమైన, కాంతిగలprakaaSamaina, kaaMtigala
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            catపిల్లి, మార్జాలముpilli, maarjaalamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            certain, definiteకచ్చితముkachchitamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            correctionసవరణsavaraNa
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            costవెలvela
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            cultivationకృషిkRshi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            destination, goalగమ్యస్థానముgamyasthaanamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            dimకాంతిలేనిkaaMtilaeni
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            dogకుక్క, శునకముkukka, Sunakamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            doubtసందేహముsaMdaehamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            easyసులభముsulabhamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            end, terminationఅంతము, తుదaMtamu, tuda
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            exam, testపరీక్షpareeksha
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            expertiseప్రావీణ్యముpraaveeNyamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            explanation, specification, comment, description, detailed accountవివరము, వివరణముvivaramu, vivaraNamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            extremeవిపరీతముvipareetamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            fan (wind)విసన కఱvisana ka~ra
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            fridayశుక్రవారముSukravaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            goodbyeసెలవుselavu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            hello, hiనమస్కారముnamaskaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            historyచరిత్రముcharitramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            home, residenceనివాసముnivaasamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            lectureప్రసంగముprasaMgamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            lightవెలుతురు, ప్రకాశము, కాంతిveluturu, prakaaSamu, kaaMti
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            mastery, eminent skill, command, proficiencyప్రవీణత, ప్రావీణ్యముpraveeNata, praaveeNyamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            maximum, at mostఅధికముadhikamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            microorganismసూక్ష్మజీవుsookshmajeevu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            minimum, at leastకనీసముkaneesamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            modesty, reverenceవినయముvinayamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            mondayసోమవారముsOmavaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            monthనెల, మాసముnela, maasamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            nonsenseఅర్థమియ్యనిమాటలు, నిరర్థకభాషణము, ఆనందర్భభాషణముarthamiyyanimaaTalu, nirarthakabhaashaNamu, aanaMdarbhabhaashaNamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            normal, usualసాదాహరనముsaadaaharanamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            onlyకేవలముkaevalamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ordinaryసామాన్యముsaamaanyamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            part, segmentభాగముbhaagamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            pathమార్గము, దారిmaargamu, daari
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            pictureచిత్రముchitramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            pleaseదయచేసిdayachaesi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            point of the compass, directionదిశdiSa
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            porch, yard, lawnప్రాంగణముpraaMgaNamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            practiceసాధన, అభ్యాసముsaadhana, abhyaasamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            printముద్రవేయు, అ~ccuవేయుmudravaeyu, a~ccuvaeyu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            publication, announcementప్రకటముprakaTamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            questionప్రష్ణprashNa
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            quotationఅనుకరణముanukaraNamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            rejoiceఅభినందించుabhinaMdiMchu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            roadవీదిveedi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sameసమానముsamaanamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            saturdayశనివారముSanivaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            schoolపాటశాలpaaTaSaala
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            shop, storeఅంగడిaMgaDi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            smooth, soft, tenderమృదువుmRduvu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            strongదృఢమైన, బలమైనdRDhamaina, balamaina
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            studentవిధ్యార్థిvidhyaarthi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            suddenlyఆకస్మికముగాaakasmikamugaa
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sundayఆదివారముaadivaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            surpriseఅమోఘముamOghamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            suspicionఅనుమానముanumaanamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            teacherఉపాధ్యాయుడుupaadhyaayuDu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            thank youధన్యవాదము, కృతజ్ఞతలుdhanyavaadamu, kRtaj~natalu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            thursdayగురువారముguruvaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            timeసమయముsamayamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            translationఅనువాదముanuvaadamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            tuesdayమంగలవారముmaMgalavaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            universityవిశ్వవిధ్యాలయముviSvavidhyaalayamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            valueవిలువviluva
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            variousవివిధమైనvividhamaina
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            vehicleవాహనముvaahanamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            wayగతి, మార్గముgati, maargamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            wednesdayభుదవారముbhudavaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            weekవారముvaaramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            weird, strangeవిచిత్రముvichitramu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            welcomeసుస్వాగతముsusvaagatamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            wonder, aweఅద్భుతముadbhutamu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/test-loop.html b/test-loop.html new file mode 100644 index 0000000..3df75bf --- /dev/null +++ b/test-loop.html @@ -0,0 +1,48 @@ +Continuous testing for Ruby with fork/eval - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Continuous testing for Ruby with fork/eval

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Test Driven Development (TDD) is by no doubt +a cornerstone of the modern Software Engineering discipline, especially in the +Ruby programming world.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            A few weeks ago, I felt that I had remained a TDD spectator for too long and +decided to jump on the TDD bandwagon once and for all. Under TDD, my Ruby on +Rails application progressed slowly but reliably and I experienced a newfound +sense of confidence and euphoria whilst developing it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Alas, the good times soon turned sour, as my tests took longer to run with +each passing day (and the number of new tests I wrote therein). Things could +not go on this way if I were to continue practicing TDD, so I began looking +for ways of continuously running tests using the fork/eval approach, where the +test execution overhead would be absorbed by the continuous testing daemon and +my tests would thereby run very quickly.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            I tried AutoTest +first, but soon noticed that it shelled-out to Ruby in order to run tests, +meaning that it did not absorb the test execution overhead as I hoped. +Instead, all it did was to automatically perform the equivalent of rake test +whenever my source files changed.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Next I tried Watchr, +whose examples suggested that it, like autotest, was best for shelling-out to +Ruby to run tests whenever my source files changed.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Finally, I gave up on the search and instead created my own continuous testing +tool called test-loop which follows the +forementioned fork/eval approach to speed up test execution. With this tool, I +am now more productive with TDD than ever because my tests finish running +within seconds after I save my source code! TDD FTW :-)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/text-formatting-with-smart-crown-margins.html b/text-formatting-with-smart-crown-margins.html new file mode 100644 index 0000000..5793b7c --- /dev/null +++ b/text-formatting-with-smart-crown-margins.html @@ -0,0 +1,61 @@ +Text formatting with smart crown margins - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Text formatting with smart crown margins

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Usage
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  When composing plain text files, I like to let each paragraph occupy an +entire line because I do not enjoy manually formatting my paragraphs. +Instead, I let the computer format and beautify my work – a task so +fitting for one who never tires of mundane, repetitive misery. ;-)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  In particular, I’ve come to prefer the fmt -c command because it +preserves indentation of paragraphs. However, the command does not respect +the crown margins of lists and bullet points very well. For example, +consider the following:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  $ cat foo
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    *   This line is intentionally long, in order to illustrate the effects of word wrapping. In any other situation, it would be unbearably terse, not unlike the barren core of a black hole.  Or so I think...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +$ fmt -w 70 -c foo
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    *   This line is intentionally long, in order to illustrate the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    effects of word wrapping. In any other situation, it would be
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    unbearably terse, not unlike the barren core of a black hole.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    Or so I think...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Notice how the first word of the second line (“effects”) is vertically +aligned with the asterisk immediately above it rather than being +vertically aligned with the first word of the first sentence (“This”). +This arrangement hinders quick scanning of text and also makes the text +appear unpolished.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  To solve the problem, I wrote a small tool in Ruby that +properly accommodates lists and bullet points. For instance, observe how +this tool handles the previous example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  $ wrap-text -w 70 < foo
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    *   This line is intentionally long, in order to illustrate the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +        effects of word wrapping. In any other situation, it would be
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +        unbearably terse, not unlike the barren core of a black hole.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +        Or so I think...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  In addition, this tool also accommodates crowns composed purely of +whitespace. For example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  $ tr -d \* < foo | wrap-text -w 70
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +       This line is intentionally long, in order to illustrate the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +       effects of word wrapping. In any other situation, it would be
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +       unbearably terse, not unlike the barren core of a black hole.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +       Or so I think...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Usage

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Usage: wrap-text [options]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    -h, --help                       show this help message
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    -w, --width WIDTH                maximum line width
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +                                     (default: 80)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    -s, --split-only                 split long lines, but do not refill
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +                                     (default: false)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    -2, --two-space                  two spaces after sentences
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +                                     (default: false)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    -b, --balance                    prefer equal line widths
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +                                     (default: false)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    -m, --select REGEXP              only wrap lines that match REGEXP
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +                                     (default: //)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +    -M, --reject REGEXP              do not wrap lines that match REGEXP
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +                                     (default: nil)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  \ No newline at end of file diff --git a/the-cult-of-codethulu.html b/the-cult-of-codethulu.html new file mode 100644 index 0000000..27e7025 --- /dev/null +++ b/the-cult-of-codethulu.html @@ -0,0 +1,55 @@ +The Cult of Codethulu - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The Cult of Codethulu

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  the anonymous embedded programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The following is a reprint of The Cult of Codethulu © 1982 +the anonymous embedded programmer. See also The Call of Codethulhu by Alex Papadimoulis, 2006.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +"The Call of Codethulhu" illustration by George E. McDougall +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Since time immemorial, new programmers have appeared in order to bring +change to the world. They wish for a chance to show the world their +skill and ability. And for their sins, they get it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  3. And then shall the young and inexperienced programmer proclaim loudly +to all who will listen:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Those who came before me were ignorant and foolish.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Codethulu looks on, and says: “Well, go and see what you can do.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  5. The young and inexperienced programmer cries loudly to all who will +listen:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    This is not a program, but a refuse bin. At every turn I find +snares to catch the unwary, pits of refuse and stinking entrails, +and the very heart of it seems to be made of mud and sticks.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Codethulu looks on, and says: “Well, go and see what you can do.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  7. The young and inexperienced programmer cries loudly to all who will +listen:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    I cannot fix this. It is excrement. I can rewrite this from +scratch in less time than it will take to make the changes you seek.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Codethulu looks on, and says: “Well, go and see what you can do.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  9. The young and inexperienced programmer cries loudly to all who will +listen:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    World, hear my cry: It would be faster and easier to cast this away +into the deep, and begin afresh. I understand the way of the true +methods; I will build an elegant tower rising up out of the remains +of this awful rubbish.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Codethulu looks on, and says: “Well, go and see what you can do.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  11. Days pass, and seasons change. Projects fail, or succeed. The +details may vary, but one thing does not: On the chosen day, the +young and inexperienced programmer realizes that what he has +constructed is simply a different collection of rubbish, mud and +offal than that used by the previous tower.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  13. Codethulu looks on, and says: “Now you have become one of us.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  \ No newline at end of file diff --git a/the-sixth-sense.html b/the-sixth-sense.html new file mode 100644 index 0000000..53b82be --- /dev/null +++ b/the-sixth-sense.html @@ -0,0 +1,118 @@ +Review of M. Night Shyamalan's film "The Sixth Sense" - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Review of M. Night Shyamalan's film "The Sixth Sense"

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  One of the things I had immediately noticed when the film started was the +combination of sound and the video. The movie starts out in the basement +cellar of Malcolm’s home; a kind of dark and scary place. In this scene the +camera is placed behind the wine racks to show foreground framing, and the +loneliness as Anna and her shadow are the only ones in the room.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  In suspenseful scenes such as the scene where the intruder comes into the +bedroom, the volume dramatically increases as the audience is slowly revealed +of who the intruder is. I found that the casting choice for the initial +intruder/murderer was brilliant. He conveyed to the audience pure fear and +paranoia mixed with the social pressures of him being a “freak”.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  As for the three levels of film, they were brilliantly plotted into the movie. +At the first level of film, the audience is revealed the outcast that is Cole +the boy who can see ghosts. This title could also extend to Vincent, the +intruder/murderer who Malcolm was unable to help in the past. After all, +Malcolm does find out a mass amount of information about Cole by looking +through Vincent’s files. At the second level of film, the audience argues in +favor of Cole when Malcolm is about to give up his trials with Cole. The +audience is put into thinking that Malcolm is just giving up this case like he +had given up on Vincent years before. At the third level of film, I find that +instead of Malcolm helping out Cole solving his problems, Cole teaches Malcolm +a lot about his predicament. Malcolm does not realize that he is a ghost until +the ending. Malcolm tries to figure out what is bothering Cole, what kinds of +normal events cause such behavior in children (such as divorce). He tries to +get Cole to work with him by telling stories, showing magic tricks, and +through games. An especially symbolic scene which displays how initially, +Malcolm had no idea of what condition Cole was in, is the scene where Malcolm +asks Cole to step forward if Malcolm makes a correct assumption and take a +step back if he is wrong. The audience finds that Malcolm knows little or +nothing about Cole and the type of problems he is dealing with. Malcolm says +“that is the watch your father gave you before he went away” and Cole steps +back. At every wrong assumption, Cole reveals a bit more about his special +case. This scene shows that Malcolm (who thinks he can help almost anybody +through normal events such as divorces) is somewhat naïve in thinking he can +classify most any patient. Cole slowly reveals to Malcolm secrets of the +ghosts and secrets of himself as the movie progresses. In this sense, Cole is +actually the psychiatrist and Malcolm the patient.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I found the lighting to be extremely convincing of the suspenseful and eerie +scenes in the film. For example, there is a shot of Malcolm walking down the +street to his house, the streets are totally deserted, it is dark and gloomy, +and shadows of ivy trees create an eerie feeling in the night. Another example +is the scene where schoolmates lock Cole in a closet. The stairwell is kind of +gloomy, even though it is day outside; the lighting inside seems dulled down – +cold and harsh. There is great contrast to the white walls of the stairwell +and the dark brown, almost slick black color of the railing. It is almost +symbolic that a red balloon should float up into such a void; a connection is +shown of Cole and the red balloon. For example, when the ghost to the point +has abused Cole where he becomes unconscious, the red balloon pops. The color +and lighting in the film give a cold and distant feeling; almost as if around +every corner there lays imminent doom awaiting Cole and Malcolm. A contrary +shot to the overall lighting and color used in the film is the initial scene +where Malcolm gets his award. The color in the room is warm and golden orange. +A fantastic reflection shot is shown where Malcolm and Anna are shown through +the reflection in the award plaque. This scene can be compared to the cold and +harsh color and lighting effects used in the stairwell scene.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  There were awesome displays of cinematography and camerawork in this film. +Reflection shots for one were by far the most impressive in the film. The +scene where Cole is about to open the door to the girl’s room is absolutely +brilliant. The audience is shown the reflection of Cole and Malcolm standing +behind him and Cole reaching toward the doorknob. Another scene is the +beginning where a ghost suddenly opens up all of the cabinets in the kitchen +and Cole’s mom is shocked. When Cole leaves the table, the heat from his palms +slowly disappears from the table surface. I think this was a really good shot +because it shows the audience that Cole was sitting there the whole time, +scared, and as still as can be while his mother doesn’t have a clue about what +is going on with her son.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Bruce Willis was great as Malcolm in this film. He truly showed the pain and +suffering Malcolm was undergoing from the neglect of his wife. And the casting +of Cole to Haley Joel Osment was a great choice. The kid really showed +convincing reactions to scary events as well as the comforting events when he +is having talks with Malcolm. He did not overdo any of the scenes I thought; +he is a true prodigy! One of the best reactions I saw in the film was the +reaction of the father of the girl who was poisoned to death. The close ups of +his face and reactions to the horrible treatment of his daughter by her +attendee was sheer brilliance. This guy can really portray his character so +well. All of the actors in the film were VERY convincing and I think are +immensely talented except for the one guy who tries to hit on Malcolm’s wife. +I do not like the way he acted out his part, it is not convincing compared to +the other characters.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The soundtrack for this film truly suited the mysterious theme and suspenseful +locations. The soundtrack score conveys a sense of unknown mystery as well as +initial journey and experimentation into the unknown. I found that in the +scene where Malcolm reviews an old session tape of Vincent; music is played +until he finally stumbles upon the voice of the ghost that haunted Vincent at +the time. This symbolizes the confusion of Malcolm until he finally sees the +answer and all is silent except for the voice of the ghost. Suspenseful audio +is used to shock the audience in the scene where Cole has to urinate and the +temperature goes down. Suddenly a woman walks by which would not be very scary +by itself but the added sound! Oh my goodness that startled me up very +effectively. I would not have been scared or shocked for that one moment if it +were not for the sound.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Montage, parallel cutting, and mise en scene were very predominant themes in +the editing of this film. Quick takes of eerie ghosts walking about dark +hallways really brings chills to the audience. Time is cleverly manipulated in +the film to give a false sense of Malcolm being alive during the next fall +when he goes to visit Cole.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I chose this particular film because my cousin said it was a scary film and I +was also interested because it is written and directed by an Indian guy. I do +not see many Indian people in American film so I though this would be a good +chance for me to see what has been done by those that are already in the film +industry. This movie had a really great effect on me. Even now as I am writing +this, mind wanders to the empty places in my room. The film has made me very +paranoid and I hope this feeling will pass soon because I cannot live in fear +like this! This does however give me a bit of insight into Cole who is +constantly scared by ghosts. I am really scaring myself now, I should stop. +This was a very well done film in my opinion. It includes three levels of +film, brilliant editing, cinematography and sound. Most importantly the +McGuffin and twist present in the film are one of my favorite aspects of the +film. I was so surprised to find that Malcolm was actually dead the whole +time. This then made me realize all of the little details during the film, +like the fact that Malcolm never touches Cole.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  This has been one of the best films I’ve seen in a while and I highly +recommend it. It will be put in my favorites list and I think I will go out +and buy the DVD.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  \ No newline at end of file diff --git a/the-umbrella-of-sacrifice.html b/the-umbrella-of-sacrifice.html new file mode 100644 index 0000000..85b1aed --- /dev/null +++ b/the-umbrella-of-sacrifice.html @@ -0,0 +1,20 @@ +The umbrella of sacrifice - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The umbrella of sacrifice

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  While watching a rainy scene in a silly Hong Kong film called Elixir of +Love, I noticed that in order for two +people (each with their own umbrella) to embrace, one of them must first +sacrifice their umbrella, become wet in the rain, and finally get underneath +the other’s umbrella. Otherwise, as the two people draw near, their umbrellas +will collide and prevent them from embracing, as shown in the film.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I felt happy to understand the symbolic meaning of that scene: in order to +advance or improve in life, one must let go of or sacrifice one’s safe and +comfortable environment. If one is unwilling to perform such sacrifice but +still wants to advance, then one is foolish, illusioned and will not succeed +in any attempts at advancement. In fact, such a person is forever tormented by +their desires, just as a spoiled child throws a tantrum, is unable to think, +and increases his sorrow when he is not given what he wants.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Therefore, be not afraid of the chilling rain! Sacrifice your umbrella and +proceed forth, towards your destiny!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  \ No newline at end of file diff --git a/tmux-24bit-color.html b/tmux-24bit-color.html new file mode 100644 index 0000000..d38a37c --- /dev/null +++ b/tmux-24bit-color.html @@ -0,0 +1,620 @@ +Adding 24-bit TrueColor RGB escape sequences to tmux - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Adding 24-bit TrueColor RGB escape sequences to tmux

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Demonstration of 24-bit colors in tmux under st 0.6 +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Story
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Usage
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Patch

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Story

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Several months ago, I embarked on a journey to revive +Koichi Shiraishi’s patch, which derives from Christian Hopps’s patch, which in turn derives from Arnis Lapsa’s patch. This patchwork +added support for 24-bit RGB color escape sequences in tmux but remained +unofficial and diverged over time because it wasn’t contributed upstream.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        With Nicholas Marriott’s invaluable assistance and testing/encouragement from +fellow tmux enthusiasts, I rebased the once obsolete patchwork atop tmux’s +master branch, enhanced it further, and contributed it back as a pull +request. The result of all this effort is illustrated by the smooth bands +of 24-bit color gradients permeating the lower half of the screenshot above.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Nicholas Marriott finally merged the pull request into tmux’s master branch +yesterday, making it an official part of tmux and bringing my months-long +journey to a happy end: it feels victorious to have helped improve tmux +again because, in addition to being one of my +favorite tools, tmux is indispensable to hordes of +programmers today and, given the terminal environment’s triumphant 50-year +resilience to digital obsolescence, perhaps even so in decades to come!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Usage

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Enable the Tc terminal capability for the outer terminal (to which tmux is +attached) by setting the terminal-overrides option in tmux and subsequently +detach and reattach tmux, as the following example (wherein $TERM is +st-256color and % is a shell prompt) illustrates:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Outside tmux:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          % echo $TERM
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +st-256color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +% tmux attach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3. Inside tmux:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          % tmux set-option -ga terminal-overrides ",st-256color:Tc"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +% tmux detach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        5. Outside tmux:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          % tmux attach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Afterwards, you can run the following command to check whether the Tc +terminal capability has been enabled properly for the outer terminal:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        tmux info | grep Tc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        If the command reports Tc: [missing], then support for 24-bit colors has +not been enabled properly because the terminal-overrides option may have +specified the outer terminal’s $TERM value incorrectly or because tmux may +have been reattached to an entirely different outer terminal altogether.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Patch

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        This patch (available as a downloadable Git patch +file) adds support for 24-bit RGB color escape +sequences in tmux, as requested in tmux issue #34, by adjusting Koichi +Shiraishi’s patch, which derives from Christian Hopps’s patch, +which in turn derives from Arnis Lapsa’s patch, with Nicholas +Marriott’s assistance.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + grid.c     |  11 +++-
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + input.c    |  35 +++++++-----
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tmux.1     |  12 ++--
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tmux.h     |  20 ++++++-
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tty-term.c |   1 +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tty.c      | 185 ++++++++++++++++++++++++++++++++++++++++++++++++++-----------
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + 6 files changed, 209 insertions(+), 55 deletions(-)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +diff --git a/grid.c b/grid.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +index c24e6c6..782032f 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +--- a/grid.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++++ b/grid.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -37,7 +37,7 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + /* Default grid cell data. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + const struct grid_cell grid_default_cell = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   0, 0, 8, 8, { { ' ' }, 0, 1, 1 }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   0, 0, { .fg = 8 }, { .bg = 8 }, { { ' ' }, 0, 1, 1 }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + };
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + const struct grid_cell_entry grid_default_entry = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        0, { .data = { 0, 8, 8, ' ' } }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -284,6 +284,7 @@ grid_set_cell(struct grid *gd, u_int px, u_int py, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        struct grid_line    *gl;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        struct grid_cell_entry  *gce;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        struct grid_cell    *gcp;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   int          extended;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        if (grid_check_y(gd, py) != 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -293,8 +294,12 @@ grid_set_cell(struct grid *gd, u_int px, u_int py, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        gl = &gd->linedata[py];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        gce = &gl->celldata[px];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   if ((gce->flags & GRID_FLAG_EXTENDED) || gc->data.size != 1 ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       gc->data.width != 1) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   extended = (gce->flags & GRID_FLAG_EXTENDED);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (!extended && (gc->data.size != 1 || gc->data.width != 1))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       extended = 1;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (!extended && (gc->flags & (GRID_FLAG_FGRGB|GRID_FLAG_BGRGB)))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       extended = 1;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (extended) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                if (~gce->flags & GRID_FLAG_EXTENDED) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gl->extddata = xreallocarray(gl->extddata,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                            gl->extdsize + 1, sizeof *gl->extddata);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +diff --git a/input.c b/input.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +index 1772a4c..ae20502 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +--- a/input.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++++ b/input.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1629,18 +1629,20 @@ input_csi_dispatch_sgr_256(struct input_ctx *ictx, int fgbg, u_int *i)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        c = input_get(ictx, *i, 0, -1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        if (c == -1) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                if (fgbg == 38) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           gc->flags &= ~GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~(GRID_FLAG_FG256|GRID_FLAG_FGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->fg = 8;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                } else if (fgbg == 48) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           gc->flags &= ~GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~(GRID_FLAG_BG256|GRID_FLAG_BGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->bg = 8;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        } else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                if (fgbg == 38) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->flags |= GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~GRID_FLAG_FGRGB;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->fg = c;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                } else if (fgbg == 48) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->flags |= GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~GRID_FLAG_BGRGB;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->bg = c;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1651,7 +1653,7 @@ void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + input_csi_dispatch_sgr_rgb(struct input_ctx *ictx, int fgbg, u_int *i)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        struct grid_cell    *gc = &ictx->cell.cell;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   int          c, r, g, b;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   int          r, g, b;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        (*i)++;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        r = input_get(ictx, *i, 0, -1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1666,13 +1668,18 @@ input_csi_dispatch_sgr_rgb(struct input_ctx *ictx, int fgbg, u_int *i)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        if (b == -1 || b > 255)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   c = colour_find_rgb(r, g, b);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        if (fgbg == 38) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       gc->flags |= GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       gc->fg = c;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->flags &= ~GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->flags |= GRID_FLAG_FGRGB;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->fg_rgb.r = r;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->fg_rgb.g = g;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->fg_rgb.b = b;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        } else if (fgbg == 48) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       gc->flags |= GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       gc->bg = c;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->flags &= ~GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->flags |= GRID_FLAG_BGRGB;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->bg_rgb.r = r;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->bg_rgb.g = g;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       gc->bg_rgb.b = b;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1754,11 +1761,11 @@ input_csi_dispatch_sgr(struct input_ctx *ictx)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 35:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 36:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 37:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           gc->flags &= ~GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~(GRID_FLAG_FG256|GRID_FLAG_FGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->fg = n - 30;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 39:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           gc->flags &= ~GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~(GRID_FLAG_FG256|GRID_FLAG_FGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->fg = 8;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 40:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1769,11 +1776,11 @@ input_csi_dispatch_sgr(struct input_ctx *ictx)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 45:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 46:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 47:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           gc->flags &= ~GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~(GRID_FLAG_BG256|GRID_FLAG_BGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->bg = n - 40;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 49:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           gc->flags &= ~GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~(GRID_FLAG_BG256|GRID_FLAG_BGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->bg = 8;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 90:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1784,7 +1791,7 @@ input_csi_dispatch_sgr(struct input_ctx *ictx)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 95:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 96:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 97:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           gc->flags &= ~GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~(GRID_FLAG_FG256|GRID_FLAG_FGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->fg = n;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 100:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1795,7 +1802,7 @@ input_csi_dispatch_sgr(struct input_ctx *ictx)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 105:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 106:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                case 107:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           gc->flags &= ~GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~(GRID_FLAG_BG256|GRID_FLAG_BGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        gc->bg = n - 10;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +diff --git a/tmux.1 b/tmux.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +index 6a4b561..fcf388a 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +--- a/tmux.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++++ b/tmux.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -2925,7 +2925,7 @@ and poor for interactive programs such as shells.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Op Ic on | off
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Xc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + Allow programs to change the window name using a terminal escape
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-sequence (\\033k...\\033\\\\).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++sequence (\eek...\ee\e\e).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + The default is on.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Pp
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .It Xo Ic alternate-screen
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -4029,7 +4029,7 @@ This command only works from outside
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .El
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Sh TERMINFO EXTENSIONS
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Nm
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-understands some extensions to
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++understands some unofficial extensions to
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Xr terminfo 5 :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Bl -tag -width Ds
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .It Em Cs , Cr
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -4053,10 +4053,12 @@ $ printf '\e033[4 q'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + If
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Em Se
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + is not set, \&Ss with argument 0 will be used to reset the cursor style instead.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++.It Em \&Tc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++Indicate that the terminal supports the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++.Ql direct colour
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++RGB escape sequence (for example, \ee[38;2;255;255;255m).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .It Em \&Ms
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-This sequence can be used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-.Nm
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-to store the current buffer in the host terminal's selection (clipboard).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++Store the current buffer in the host terminal's selection (clipboard).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + See the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + .Em set-clipboard
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + option above and the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +diff --git a/tmux.h b/tmux.h
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +index 1ca6ef3..4bdc8af 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +--- a/tmux.h
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++++ b/tmux.h
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -387,6 +387,7 @@ enum tty_code_code {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        TTYC_SMSO,  /* enter_standout_mode, so */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        TTYC_SMUL,  /* enter_underline_mode, us */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        TTYC_SS,    /* set cursor style, Ss */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   TTYC_TC,    /* 24-bit "true" colour, Tc */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        TTYC_TSL,   /* to_status_line, tsl */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        TTYC_VPA,   /* row_address, cv */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        TTYC_XENL,  /* eat_newline_glitch, xn */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -643,16 +644,31 @@ enum utf8_state {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + #define GRID_FLAG_BG256 0x2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + #define GRID_FLAG_PADDING 0x4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + #define GRID_FLAG_EXTENDED 0x8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++#define GRID_FLAG_FGRGB 0x10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++#define GRID_FLAG_BGRGB 0x20
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + /* Grid line flags. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + #define GRID_LINE_WRAPPED 0x1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++/* Grid cell RGB colours. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++struct grid_cell_rgb {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   u_char  r;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   u_char  g;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   u_char  b;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++};
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + /* Grid cell data. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + struct grid_cell {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        u_char          flags;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        u_char          attr;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   u_char          fg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   u_char          bg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   union {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       u_char      fg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       struct grid_cell_rgb    fg_rgb;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   };
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   union {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       u_char      bg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       struct grid_cell_rgb    bg_rgb;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   };
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        struct utf8_data    data;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + };
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +diff --git a/tty-term.c b/tty-term.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +index 4d41fd8..a3a2636 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +--- a/tty-term.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++++ b/tty-term.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -254,6 +254,7 @@ const struct tty_term_code_entry tty_term_codes[] = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        [TTYC_SMSO] = { TTYCODE_STRING, "smso" },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        [TTYC_SMUL] = { TTYCODE_STRING, "smul" },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        [TTYC_SS] = { TTYCODE_STRING, "Ss" },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   [TTYC_TC] = { TTYCODE_FLAG, "Tc" },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        [TTYC_TSL] = { TTYCODE_STRING, "tsl" },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        [TTYC_VPA] = { TTYCODE_STRING, "vpa" },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        [TTYC_XENL] = { TTYCODE_FLAG, "xenl" },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +diff --git a/tty.c b/tty.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +index 52521be..c6fc221 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +--- a/tty.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++++ b/tty.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -36,8 +36,15 @@ static int tty_log_fd = -1;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void   tty_read_callback(struct bufferevent *, void *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void   tty_error_callback(struct bufferevent *, short, void *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int tty_same_fg(const struct grid_cell *, const struct grid_cell *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int tty_same_bg(const struct grid_cell *, const struct grid_cell *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int tty_same_colours(const struct grid_cell *, const struct grid_cell *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int tty_is_fg(const struct grid_cell *, int);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int tty_is_bg(const struct grid_cell *, int);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void   tty_set_italics(struct tty *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + int    tty_try_256(struct tty *, u_char, const char *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++int    tty_try_rgb(struct tty *, const struct grid_cell_rgb *, const char *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void   tty_colours(struct tty *, const struct grid_cell *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void   tty_check_fg(struct tty *, struct grid_cell *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -61,6 +68,74 @@ void tty_default_colours(struct grid_cell *, const struct window_pane *);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + #define tty_pane_full_width(tty, ctx) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        ((ctx)->xoff == 0 && screen_size_x((ctx)->wp->screen) >= (tty)->sx)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++tty_same_fg(const struct grid_cell *gc1, const struct grid_cell *gc2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   int flags1, flags2;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   flags1 = (gc1->flags & (GRID_FLAG_FG256|GRID_FLAG_FGRGB));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   flags2 = (gc2->flags & (GRID_FLAG_FG256|GRID_FLAG_FGRGB));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (flags1 != flags2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (flags1 & GRID_FLAG_FGRGB) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (gc1->fg_rgb.r != gc2->fg_rgb.r)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (gc1->fg_rgb.g != gc2->fg_rgb.g)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (gc1->fg_rgb.b != gc2->fg_rgb.b)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return (1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   return (gc1->fg == gc2->fg);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++tty_same_bg(const struct grid_cell *gc1, const struct grid_cell *gc2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   int flags1, flags2;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   flags1 = (gc1->flags & (GRID_FLAG_BG256|GRID_FLAG_BGRGB));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   flags2 = (gc2->flags & (GRID_FLAG_BG256|GRID_FLAG_BGRGB));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (flags1 != flags2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (flags1 & GRID_FLAG_BGRGB) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (gc1->bg_rgb.r != gc2->bg_rgb.r)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (gc1->bg_rgb.g != gc2->bg_rgb.g)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (gc1->bg_rgb.b != gc2->bg_rgb.b)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return (1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   return (gc1->bg == gc2->bg);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++tty_same_colours(const struct grid_cell *gc1, const struct grid_cell *gc2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   return (tty_same_fg(gc1, gc2) && tty_same_bg(gc1, gc2));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++tty_is_fg(const struct grid_cell *gc, int c)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (gc->flags & (GRID_FLAG_FG256|GRID_FLAG_FGRGB))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   return (gc->fg == c);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++static int
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++tty_is_bg(const struct grid_cell *gc, int c)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (gc->flags & (GRID_FLAG_BG256|GRID_FLAG_BGRGB))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   return (gc->bg == c);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tty_create_log(void)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1423,12 +1498,10 @@ void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tty_colours(struct tty *tty, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        struct grid_cell    *tc = &tty->cell;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   u_char           fg = gc->fg, bg = gc->bg, flags = gc->flags;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        int          have_ax, fg_default, bg_default;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /* No changes? Nothing is necessary. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   if (fg == tc->fg && bg == tc->bg &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       ((flags ^ tc->flags) & (GRID_FLAG_FG256|GRID_FLAG_BG256)) == 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (tty_same_colours(gc, tc))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /*
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1437,8 +1510,8 @@ tty_colours(struct tty *tty, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +         * case if only one is default need to fall onward to set the other
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +         * colour.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +         */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   fg_default = (fg == 8 && !(flags & GRID_FLAG_FG256));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   bg_default = (bg == 8 && !(flags & GRID_FLAG_BG256));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   fg_default = tty_is_fg(gc, 8);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   bg_default = tty_is_bg(gc, 8);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        if (fg_default || bg_default) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                /*
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                 * If don't have AX but do have op, send sgr0 (op can't
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1451,48 +1524,52 @@ tty_colours(struct tty *tty, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                if (!have_ax && tty_term_has(tty->term, TTYC_OP))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        tty_reset(tty);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           if (fg_default &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-               (tc->fg != 8 || tc->flags & GRID_FLAG_FG256)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           if (fg_default && !tty_is_fg(tc, 8)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                                if (have_ax)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                                        tty_puts(tty, "\033[39m");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-               else if (tc->fg != 7 ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-                   tc->flags & GRID_FLAG_FG256)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++               else if (!tty_is_fg(tc, 7))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                                        tty_putcode1(tty, TTYC_SETAF, 7);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                                tc->fg = 8;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-               tc->flags &= ~GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++               tc->flags &= ~(GRID_FLAG_FG256|GRID_FLAG_FGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-           if (bg_default &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-               (tc->bg != 8 || tc->flags & GRID_FLAG_BG256)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           if (bg_default && !tty_is_bg(tc, 8)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                                if (have_ax)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                                        tty_puts(tty, "\033[49m");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-               else if (tc->bg != 0 ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-                   tc->flags & GRID_FLAG_BG256)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++               else if (!tty_is_bg(tc, 0))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                                        tty_putcode1(tty, TTYC_SETAB, 0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                                tc->bg = 8;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-               tc->flags &= ~GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++               tc->flags &= ~(GRID_FLAG_BG256|GRID_FLAG_BGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /* Set the foreground colour. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   if (!fg_default && (fg != tc->fg ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       ((flags & GRID_FLAG_FG256) != (tc->flags & GRID_FLAG_FG256))))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (!fg_default && !tty_same_fg(gc, tc))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                tty_colours_fg(tty, gc);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /*
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +         * Set the background colour. This must come after the foreground as
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +         * tty_colour_fg() can call tty_reset().
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +         */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   if (!bg_default && (bg != tc->bg ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       ((flags & GRID_FLAG_BG256) != (tc->flags & GRID_FLAG_BG256))))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (!bg_default && !tty_same_bg(gc, tc))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                tty_colours_bg(tty, gc);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tty_check_fg(struct tty *tty, struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   u_int   colours;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   struct grid_cell_rgb    *rgb = &gc->fg_rgb;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   u_int            colours;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   /* Is this a 24-bit colour? */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (gc->flags & GRID_FLAG_FGRGB) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       /* Not a 24-bit terminal? Translate to 256-colour palette. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (!tty_term_flag(tty->term, TTYC_TC)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~GRID_FLAG_FGRGB;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags |= GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->fg = colour_find_rgb(rgb->r, rgb->g, rgb->b);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        colours = tty_term_number(tty->term, TTYC_COLORS);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /* Is this a 256-colour colour? */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1524,8 +1601,18 @@ tty_check_fg(struct tty *tty, struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tty_check_bg(struct tty *tty, struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   u_int   colours;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   struct grid_cell_rgb    *rgb = &gc->bg_rgb;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   u_int            colours;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   /* Is this a 24-bit colour? */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (gc->flags & GRID_FLAG_BGRGB) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       /* Not a 24-bit terminal? Translate to 256-colour palette. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (!tty_term_flag(tty->term, TTYC_TC)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags &= ~GRID_FLAG_BGRGB;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->flags |= GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           gc->bg = colour_find_rgb(rgb->r, rgb->g, rgb->b);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        colours = tty_term_number(tty->term, TTYC_COLORS);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /* Is this a 256-colour colour? */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1560,12 +1647,21 @@ tty_colours_fg(struct tty *tty, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        u_char           fg = gc->fg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        char             s[32];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   tc->flags &= ~(GRID_FLAG_FG256|GRID_FLAG_FGRGB);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   /* Is this a 24-bit colour? */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (gc->flags & GRID_FLAG_FGRGB) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (tty_try_rgb(tty, &gc->fg_rgb, "38") == 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           goto save_fg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       /* Should not get here, already converted in tty_check_fg. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /* Is this a 256-colour colour? */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        if (gc->flags & GRID_FLAG_FG256) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       /* Try as 256 colours. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                if (tty_try_256(tty, fg, "38") == 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        goto save_fg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       /* Else already handled by tty_check_fg. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       /* Should not get here, already converted in tty_check_fg. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1581,9 +1677,12 @@ tty_colours_fg(struct tty *tty, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + save_fg:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /* Save the new values in the terminal current cell. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   tc->fg = fg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   tc->flags &= ~GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   tc->flags |= gc->flags & GRID_FLAG_FG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (gc->flags & GRID_FLAG_FGRGB)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       memcpy(&tc->fg_rgb, &gc->fg_rgb, sizeof tc->fg_rgb);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   else
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       tc->fg = fg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   tc->flags &= ~(GRID_FLAG_FGRGB|GRID_FLAG_FG256);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   tc->flags |= (gc->flags & (GRID_FLAG_FG256|GRID_FLAG_FGRGB));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1593,12 +1692,19 @@ tty_colours_bg(struct tty *tty, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        u_char           bg = gc->bg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        char             s[32];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   /* Is this a 24-bit colour? */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (gc->flags & GRID_FLAG_BGRGB) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       if (tty_try_rgb(tty, &gc->bg_rgb, "48") == 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++           goto save_bg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       /* Should not get here, already converted in tty_check_bg. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /* Is this a 256-colour colour? */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        if (gc->flags & GRID_FLAG_BG256) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       /* Try as 256 colours. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                if (tty_try_256(tty, bg, "48") == 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                        goto save_bg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-       /* Else already handled by tty_check_bg. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       /* Should not get here, already converted in tty_check_bg. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1614,9 +1720,12 @@ tty_colours_bg(struct tty *tty, const struct grid_cell *gc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + save_bg:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        /* Save the new values in the terminal current cell. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   tc->bg = bg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   tc->flags &= ~GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-   tc->flags |= gc->flags & GRID_FLAG_BG256;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (gc->flags & GRID_FLAG_BGRGB)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       memcpy(&tc->bg_rgb, &gc->bg_rgb, sizeof tc->bg_rgb);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   else
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       tc->bg = bg;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   tc->flags &= ~(GRID_FLAG_BGRGB|GRID_FLAG_BG256);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   tc->flags |= (gc->flags & (GRID_FLAG_BG256|GRID_FLAG_BGRGB));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + int
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1656,6 +1765,20 @@ fallback:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +        return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++int
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++tty_try_rgb(struct tty *tty, const struct grid_cell_rgb *rgb, const char *type)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   char    s[32];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   if (!tty_term_flag(tty->term, TTYC_TC))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       return (-1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   xsnprintf(s, sizeof s, "\033[%s;2;%hhu;%hhu;%hhum", type, rgb->r,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++       rgb->g, rgb->b);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   tty_puts(tty, s);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++   return (0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + tty_default_colours(struct grid_cell *gc, const struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +--
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +2.7.0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        \ No newline at end of file diff --git a/tmux-half-screen-tiling-layouts.html b/tmux-half-screen-tiling-layouts.html new file mode 100644 index 0000000..3b3be2a --- /dev/null +++ b/tmux-half-screen-tiling-layouts.html @@ -0,0 +1,17 @@ +Half-screen tiling layouts in tmux - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Half-screen tiling layouts in tmux

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        When applying tmux’s main-horizontal and main-vertical layouts, I +prefer to have the main pane occupy half of the available screen space. +So, I wrote the following configuration snippet to achieve just that!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        # main-vertical layout with the main pane occupying half of the screen
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +bind-key -n M-w select-layout main-horizontal \; run-shell 'tmux resize-pane -t 1 -y $(( #{window_height} / 2 ))'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +# main-horizontal layout with the main pane occupying half of the screen
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +bind-key -n M-v select-layout main-vertical \; run-shell 'tmux resize-pane -t 1 -x $(( #{window_width} / 2 ))'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        \ No newline at end of file diff --git a/tmux-layout-dwindle.html b/tmux-layout-dwindle.html new file mode 100644 index 0000000..910fd58 --- /dev/null +++ b/tmux-layout-dwindle.html @@ -0,0 +1,321 @@ +Porting dwm's dwindle layout to tmux - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Porting dwm's dwindle layout to tmux

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        A sample result of running `tmux-layout-dwindle`. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. ~/bin/tmux-layout-dwindle

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            After months of tolerating the corruption of my perfectly balanced Binary +Space Partitioned (BSP) layouts in tmux whenever I happened to temporarily +create a split pane to pursue some context-dependent endeavor, I dedicated +myself to safeguarding my BSP layouts once and for all by automating their +restoration.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Thus I present to you my port of Niki Yoshiuchi’s dwindle and spiral +layouts from dwm to tmux in +the form of a POSIX shell script, listed below and available on GitHub, which +surpasses dwm’s concept by letting you dwindle or spiral panes toward any +corner while laying the main pane along any side of your tmux window.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ~/bin/tmux-layout-dwindle

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            #!/bin/sh -eu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# Usage: tmux-layout-dwindle [tblrhvsc]...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# Arranges panes in the current window into Binary Space Partitions of
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# dwindling size towards a corner of the screen (tl, tr, bl, br) along
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# a straight line (c) or spiral trajectory (s) while laying out branch
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# panes either vertically (v) or horizontally (h) to produce one of 16
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# possible orientations, illustrated below, of which "brvc" is default.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# Inspired by the dwindle and spiral layout concepts by Niki Yoshiuchi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# in dwm's fibonacci patch <http://dwm.suckless.org/patches/fibonacci>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                        oooo    ooo  .ooooo.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         `88.  .8'  d88' `"Y8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                          `88..8'   888
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                           `888'    888   .o8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                            `8'     `Y8bod8P'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                           vertical corner
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         tlvc                                           trvc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +--+--+-----+-----------+ +-----------+-----+--+--+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |\\|5 |     |           | |           |     | 5|//|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +--+--+  3  |           | |           |  3  +--+--+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |  4  |     |           | |           |     |  4  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+     1     | |     1     +-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     2     |           | |           |     2     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------+-----------+ +-----------+-----------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------+-----------+ +-----------+-----------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     2     |           | |           |     2     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+     1     | |     1     +-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |  4  |     |           | |           |     |  4  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +--+--+  3  |           | |           |  3  +--+--+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |//|5 |     |           | |           |     | 5|\\|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +--+--+-----+-----------+ +-----------+-----+--+--+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         blvc                                           brvc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                        oooo    ooo  .oooo.o
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         `88.  .8'  d88(  "8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                          `88..8'   `"Y88b.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                           `888'    o.  )88b
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                            `8'     8""888P'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                           vertical spiral
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         tlvs                                           trvs
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+-----------+ +-----------+-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     |  4  |           | |           |  4  |     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |  3  +--+--+           | |           +--+--+  3  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     |\\|5 |           | |           | 5|//|     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+--+--+     1     | |     1     +--+--+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     2     |           | |           |     2     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------+-----------+ +-----------+-----------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------+-----------+ +-----------+-----------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     2     |           | |           |     2     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+--+--+     1     | |     1     +--+--+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     |//|5 |           | |           | 5|\\|     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |  3  +--+--+           | |           +--+--+  3  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     |  4  |           | |           |  4  |     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+-----------+ +-----------+-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         blvs                                           brvs
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                        oooo
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                        `888
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         888 .oo.    .ooooo.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         888P"Y88b  d88' `"Y8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         888   888  888
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         888   888  888   .o8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                        o888o o888o `Y8bod8P'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                          horizontal corner
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         tlhc                                           trhc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+-----------+ +-----------+-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         | \\\ |     |           | |           |     | /// |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+  4  |           | |           |  4  +-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |  5  |     |           | |           |     |  5  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+     2     | |     2     +-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     3     |           | |           |     3     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------+-----------+ +-----------+-----------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           1           | |           1           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------------------+ +-----------------------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------------------+ +-----------------------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           1           | |           1           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------+-----------+ +-----------+-----------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     3     |           | |           |     3     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+     2     | |     2     +-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |  5  |     |           | |           |     |  5  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+  4  |           | |           |  4  +-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         | /// |     |           | |           |     | \\\ |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+-----------+ +-----------+-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         blhc                                           brhc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                        oooo
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                        `888
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         888 .oo.    .oooo.o
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         888P"Y88b  d88(  "8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         888   888  `"Y88b.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                         888   888  o.  )88b
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                        o888o o888o 8""888P'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#                          horizontal spiral
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         tlhs                                           trhs
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------+-----------+ +-----------+-----------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     3     |           | |           |     3     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+     2     | |     2     +-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     | \\\ |           | |           | /// |     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |  4  +-----+           | |           +-----+  4  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     |  5  |           | |           |  5  |     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+-----------+ +-----------+-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           1           | |           1           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------------------+ +-----------------------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------------------+ +-----------------------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           1           | |           1           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |                       | |                       |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+-----------+ +-----------+-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     |  5  |           | |           |  5  |     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |  4  +-----+           | |           +-----+  4  |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     | /// |           | |           | \\\ |     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----+-----+     2     | |     2     +-----+-----+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |     3     |           | |           |     3     |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         |           |           | |           |           |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         +-----------+-----------+ +-----------+-----------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#         blhs                                           brhs
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# Written in 2016 by Suraj N. Kurapati <https://github.com/sunaku>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# Documented at <https://sunaku.github.io/tmux-layout-dwindle.html>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# parse any orientation flags specified among the command-line arguments
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +case "$*" in
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  (*t*)   corner_tb=+ spiral_tb=        ;; # top
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  (*b*|*) corner_tb=  spiral_tb=+       ;; # bottom
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +esac
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +case "$*" in
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  (*l*)   corner_lr=+ spiral_lr=        ;; # left
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  (*r*|*) corner_lr=  spiral_lr=+       ;; # right
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +esac
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +case "$*" in
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  (*h*)   modulo_hv=0 is_vertical=false ;; # horizontal
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  (*v*|*) modulo_hv=1 is_vertical=true  ;; # vertical
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +esac
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +case "$*" in
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  (*s*)   is_spiral=true                ;; # spiral
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  (*c*|*) is_spiral=false               ;; # corner
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +esac
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# gather information about the current state of the window and its panes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +set -- $(tmux list-panes -F '#{pane_id}')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +selected_pane=$(tmux display-message -p '#{pane_id}')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +historic_pane=$(tmux last-pane 2>/dev/null \;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +                     display-message -p '#{pane_id}' \;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +                     last-pane) || : # exit 1: no last pane
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +window_height=$(tmux display-message -p '#{window_height}')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +# execute all tmux commands in one shot to avoid flickering and slowness
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +exec tmux $({
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  # flatten current layout, stacking all panes vertically like pancakes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  echo select-layout even-vertical
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  # transform pane stack into binary space partitions of dwindling size
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  count=1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  for pane_id; do
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    if [ $count -eq $# ]; then
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      break # skip last pane because .+1 wraps around to the first pane
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    elif [ $(( count % 2 )) -eq $modulo_hv ]; then
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      move_h=+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      if $is_spiral && [ $(( count % 5 )) -gt 2 ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      then move_b=$spiral_lr
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      else move_b=$corner_lr
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      fi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    else
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      move_h=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      if $is_spiral && [ $(( count % 5 )) -gt 2 ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      then move_b=$spiral_tb
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      else move_b=$corner_tb
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      fi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    fi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    echo resize-pane -t $pane_id -y $window_height # make room for move
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    echo select-pane -t $pane_id # for relative pane addressing in move
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    echo move-pane -d -s .+1 -t . ${move_h:+-h} ${move_b:+-b} # move it
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    count=$(( count + 1 ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  done
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  # divide available space evenly among panes (binary space partitions)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  branch_height=$window_height
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  count=1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  for pane_id; do
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    if [ $count -eq $# ] && ! $is_vertical; then
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      break # skip last pane because it will already be sized correctly
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    elif [ $(( count % 2 )) -eq 1 ]; then
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      # every other pane is a branch in the binary space partition tree
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      parent_height=$branch_height
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      branch_height=$(( branch_height / 2 ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      if $is_vertical
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      then resize_y=$parent_height
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      else resize_y=$branch_height
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      fi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +      echo resize-pane -t $pane_id -y $resize_y
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    fi
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +    count=$(( count + 1 ))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  done
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  # restore pane selection back to how it was before we did any of this
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  test -n "$historic_pane" && echo select-pane -t $historic_pane
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  echo select-pane -t $selected_pane
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +} | sed 's/$/ ;/')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \ No newline at end of file diff --git a/tmux-pane-zoom.html b/tmux-pane-zoom.html new file mode 100644 index 0000000..b5b3b16 --- /dev/null +++ b/tmux-pane-zoom.html @@ -0,0 +1,70 @@ +Temporarily zooming panes in tmux - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Temporarily zooming panes in tmux

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Obsolete!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Approach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Obsolete!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The solution in this article was made obsolete by tmux version 1.8, which +provides native support for zooming panes through the resize-pane -Z command.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    In my wmii configuration, I +often use the “client zoom” feature where a group of selected clients (or +just the currently focused client if there is no selection) is zoomed +onto a temporary view. This allows me to focus on the task at hand while +also giving more space to the client(s) that are relevant to that task.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Approach

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    I ported that feature to tmux this evening, as shown below, by enhancing +an existing snippet, which was written +by an anonymous user known only as “akshay”, in the following ways:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Use built-in POSIX sh(1) string manipulation functions +instead of running sed(1), cut(1), etc. through process substitution.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Reduce resource consumption by running a simple read-loop, as opposed to +a complete interactive shell, in the zoomed pane’s placeholder.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Travel to an already zoomed pane by invoking this feature on the zoomed +pane’s placeholder.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Allow the vertical bar delimiter (|) used in this feature to +occur naturally in window names.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    bind -n M-m run 'set -e;                                            \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  new_ip=$(tmux display-message -p "#I|#P");                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  if ! tmux select-window -t "*$new_ip"; then                       \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    old_wip=$(tmux display-message -p "#W");                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    old_w=${old_wip%|[0-9]*|[0-9]*};                                \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    if test "$old_w" != "$old_wip"; then                            \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      old_i=${old_wip%|*}; old_i=${old_i##*|};                      \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      old_p=${old_wip##*|};                                         \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      cur_i=$(tmux display-message -p "#I");                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      cur_p=$(tmux display-message -p "#P");                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      tmux select-window -t ":$old_i";                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      tmux select-pane -t ":$old_i.$old_p";                         \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      tmux swap-pane -s ":$cur_i.$cur_p";                           \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      if test "$(tmux list-panes -t ":$cur_i" | wc -l)" -le 1; then \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +        tmux kill-window -t ":$cur_i";                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      fi;                                                           \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    else                                                            \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      new_wip="$old_wip|$new_ip";                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      tmux new-window -d -n "$new_wip" "sh -c \"                    \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +        trap : INT QUIT;                                            \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +        while :; do                                                 \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +          echo PLACEHOLDER;                                         \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +          cat > /dev/null;                                          \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +        done                                                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      \"";                                                          \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      tmux swap-pane -s "$new_wip";                                 \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +      tmux select-window -t "$new_wip";                             \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    fi;                                                             \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  fi;                                                               \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/tmux-refocus-patch.html b/tmux-refocus-patch.html new file mode 100644 index 0000000..7399a9c --- /dev/null +++ b/tmux-refocus-patch.html @@ -0,0 +1,179 @@ +Remembering window pane focus in tmux - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Remembering window pane focus in tmux

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Approach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Having switched from the wmii window manager to the tmux terminal +multiplexer as my primary “desktop environment” nearly a year ago, +I have found tmux’s inability to (1) remember which pane was last +focused within a split-window and to (2) restore focus to that pane when +revisiting that split-window to be its main functional disadvantage.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          To cope, I would manually restore pane focus in tmux after moving focus +between different split-windows. This hurt my productivity since I use +split-windows heavily and switch focus between them quite frequently.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Approach

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Recently, I spent several weeknights poring over tmux’s source code in hopes +of correcting this problem once and for all. The following patch, which applies cleanly against tmux version 1.8, resulted from all +that hard work. I have since contributed it upstream, to the +“tmux-users” mailing list.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          This patch makes non-window-pane layout cells remember which of their +descendant window panes previously had focus (or was “active” in tmux +parlance) so that the focus may be restored later on, when applicable.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          For example, consider the following scenario created by steps 1-5:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1            2            3            4            5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@@@@@@@@    +---@@@@@    +---+---+    @@@@@---+    +---+---+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@       @    |   @   @    |   | Y |    @   @ Y |    |   | Y |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@   X   @    | X @ Y @    | X @@@@@    @ X @---+    | X @@@@@
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@       @    |   @   @    |   @ Z @    @   @ Z |    |   @ Z @
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@@@@@@@@    +---@@@@@    +---@@@@@    @@@@@---+    +---@@@@@
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. We run tmux new-window to create pane X.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. We run tmux split-window -h to create and focus pane Y.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          5. We run tmux split-window to create and focus pane Z.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          7. We run tmux select-pane -L to focus pane X.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          9. We run tmux select-pane -R to focus pane Z, thanks to this patch. +Without this patch, this step would focus pane Y instead of pane Z.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Although this example illustrates a rather simple scenario, note that +this patch can handle more complex (nested cell) layouts just as well.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          This is also available as a downloadable Git patch file.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          diff --git a/window.c b/window.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +index 7678adc..adb67e0 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +--- a/window.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++++ b/window.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@ -383,6 +383,34 @@ window_resize(struct window *w, u_int sx, u_int sy)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        w->sy = sy;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++/*
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++ * Commandeers the transfer of focus from `wp` to `wp2` in order to mark `wp`
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++ * so that window_pane_refocus is able to restore focus to it when necessary.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++ */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++static void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++window_pane_defocus(struct window_pane *wp, struct window_pane *wp2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   struct layout_cell *lc, *lc2;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   /* remember the target pane's focus in its parent */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   wp2->layout_cell->parent->wp = wp2;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   if (wp == NULL)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   /* remember the source pane's focus in all of its parents up to, but
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++    * not including, the common ancestor of itself and the target pane */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   for(lc = wp->layout_cell->parent; lc != NULL; lc = lc->parent) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       /* search for a common ancestor in the target's lineage */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       for(lc2 = wp2->layout_cell->parent; lc2 != NULL; lc2 = lc2->parent)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           if (lc == lc2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++               /* found a common ancestor so stop here */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++               return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       /* remember the source pane's focus in its uncommon parent */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       lc->wp = wp;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + window_set_active_pane(struct window *w, struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@ -390,6 +418,7 @@ window_set_active_pane(struct window *w, struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        w->last = w->active;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        w->active = wp;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   window_pane_defocus(w->last, wp);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        while (!window_pane_visible(w->active)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                w->active = TAILQ_PREV(w->active, window_panes, entry);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (w->active == NULL)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@ -704,6 +733,14 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + void
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + window_pane_destroy(struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   /* forget removed pane's focus in all layout cells that remember it */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   struct window_pane *wp2;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   RB_FOREACH(wp2, window_pane_tree, &all_window_panes)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       if (wp2->layout_cell != NULL &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           wp2->layout_cell->parent != NULL &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           wp2->layout_cell->parent->wp == wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           wp2->layout_cell->parent->wp = NULL; /* forget pane */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        window_pane_reset_mode(wp);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        if (event_initialized(&wp->changes_timer))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@ -1110,6 +1147,31 @@ window_pane_search(struct window_pane *wp, const char *searchstr, u_int *lineno)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        return (msg);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++/*
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++ * Commandeers the transfer of focus from `wp` to `wp2` in order to restore
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++ * focus to a previously focused window pane marked by window_pane_defocus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++ * If this is not possible, the transfer proceeds as originally intended.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++ */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++static struct window_pane *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++window_pane_refocus(struct window_pane *wp, struct window_pane *wp2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   struct layout_cell *lc;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   struct window_pane *fp; /* pane marked by window_pane_defocus */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   /* target pane's parent must not be an ancestor of source pane */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   for (lc = wp->layout_cell->parent; lc != NULL; lc = lc->parent)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       if (lc == wp2->layout_cell->parent)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           return (wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   /* focused pane, if any, must not be the same as source pane */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   lc = wp2->layout_cell->parent;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   fp = lc != NULL ? lc->wp : NULL;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   if (fp != NULL && fp != wp && window_pane_visible(fp))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       return (fp);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++   else
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++       return (wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + /* Find the pane directly above another. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + struct window_pane *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + window_pane_find_up(struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@ -1131,7 +1193,7 @@ window_pane_find_up(struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (wp2->yoff + wp2->sy + 1 != top)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                        continue;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (left >= wp2->xoff && left <= wp2->xoff + wp2->sx)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +-           return (wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           return window_pane_refocus(wp, wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        return (NULL);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@ -1157,7 +1219,7 @@ window_pane_find_down(struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (wp2->yoff != bottom)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                        continue;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (left >= wp2->xoff && left <= wp2->xoff + wp2->sx)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +-           return (wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           return window_pane_refocus(wp, wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        return (NULL);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@ -1186,7 +1248,7 @@ window_pane_find_left(struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (wp2->xoff + wp2->sx + 1 != left)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                        continue;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (top >= wp2->yoff && top <= wp2->yoff + wp2->sy)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +-           return (wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           return window_pane_refocus(wp, wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        return (NULL);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +@@ -1215,7 +1277,7 @@ window_pane_find_right(struct window_pane *wp)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (wp2->xoff != right)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                        continue;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +                if (top >= wp2->yoff && top <= wp2->yoff + wp2->sy)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +-           return (wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ++           return window_pane_refocus(wp, wp2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +        return (NULL);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/tmux-searchable-scrollback.html b/tmux-searchable-scrollback.html new file mode 100644 index 0000000..46edbc0 --- /dev/null +++ b/tmux-searchable-scrollback.html @@ -0,0 +1,25 @@ +Searching the scrollback buffer in tmux - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Searching the scrollback buffer in tmux

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Before I switched to the tmux terminal multiplexer from the wmii +window manager as my primary dwelling in the lands of Linux, I +relied upon the URxvt terminal emulator’s searchable-scrollback +Perl extension, which let me search its scrollback buffer +incrementally.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I ported that feature to tmux today, by feeding tmux’s scrollback buffer +contents into Vim for incremental search or falling back to the less(1) +pager for non-incremental search, like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          # search buffer (using less if Vim is not available)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +bind-key -n M-/ capture-pane -S -32767 -J \; new-window ' \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  tmux save-buffer - \; delete-buffer | {                 \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +    vim -R -c "set nofen is hls ic" -;                    \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +    test $? -eq 127 && less;                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +  };                                                      \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +' \; send-keys G ? # go to bottom and search upward
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The neat thing about this snippet is that both vim and less(1) accept the +same G (scroll to bottom of file) and ? (search backward) commands, so +we jump directly into search mode no matter which of them is actually run.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/tmux-select-pane.html b/tmux-select-pane.html new file mode 100644 index 0000000..83708a5 --- /dev/null +++ b/tmux-select-pane.html @@ -0,0 +1,243 @@ +Intelligently navigating tmux panes and Vim splits - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Intelligently navigating tmux panes and Vim splits

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          NOTE: The code in this article is also available as an installable, dual + tmux and Vim plugin at https://github.com/sunaku/tmux-navigate.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Approach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Running tmux select-pane in a zoomed tmux pane causes it to become unzoomed. +This causes frequent, unintentional pane unzooming when I perform seamless +navigation (which refers to using the same shortcut keys to navigate +tmux panes and Vim splits alike) as provided by the vim-tmux-navigator plugin +for Vim.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Thankfully, I learned that the plugin contains an undocumented option to disable pane +unzooming, called g:tmux_navigator_disable_when_zoomed. However, this victory +was short-lived as I soon discovered that the plugin doesn’t work when Vim is +running remotely, tunneled in from a different machine through SSH.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                For example, I often have tmux panes that run Vim on remote machines through SSH +(sometimes several layers deep!). Here, the plugin fails to navigate because the +tmux select-pane commands that it runs on my behalf (from Vim) can’t locate +my tmux session, which happens to be running on a completely different machine!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Approach

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                First, we’ll enhance the seamless navigation shortcuts to be more intelligent:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. If the current pane is zoomed but isn’t running Vim, then do nothing.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. If the current pane is zoomed and is also running Vim, then only navigate +between Vim splits inside the zoomed pane: don’t venture outside of it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. If the current pane is unzoomed, seamlessly navigate between tmux and Vim.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                We can codify these behaviors as a “truth table” composed of four major clauses:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                inside Vim?is Zoomed?Action taken by key binding
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                NoNoFocus directional tmux pane
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                NoYesNothing: ignore key binding
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                YesNoSeamlessly focus Vim / tmux
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                YesYesFocus directional Vim split
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Second, we’ll place the decision-making authority of where and how to navigate in +tmux’s hands (and not in Vim’s hands, as the vim-tmux-navigator plugin does) +because we should be able to run and control Vim on/through any remote machines.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To achieve this, we’ll inspect #{pane_current_command} to discover the local +commands currently running inside tmux panes. And for panes running SSH, we’ll +inspect #{pane_title} to help us detect which remote command they’re +currently running, since their local command is always going to be an +uninformative “ssh”.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                This is a pure tmux scripting solution that uses Vim’s titlestring feature to +detect when Vim changes focus between its split windows and/or tabs. It doesn’t +depend on the assistance of any special Vim plugins, like vim-tmux-navigator.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                First, add this snippet to your ~/.vimrc file and then restart your Vim.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                " Intelligently navigate tmux panes and Vim splits using the same keys.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +" See https://sunaku.github.io/tmux-select-pane.html for documentation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +let progname = substitute($VIM, '.*[/\\]', '', '')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +set title titlestring=%{progname}\ %f\ +%l\ #%{tabpagenr()}.%{winnr()}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +if &term =~ '^screen' && !has('nvim') | exe "set t_ts=\e]2; t_fs=\7" | endif
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Second, add this snippet to your ~/.tmux.conf file and then reload your tmux.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                # Intelligently navigate tmux panes and Vim splits using the same keys.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +# See https://sunaku.github.io/tmux-select-pane.html for documentation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#      +-------------+------------+-----------------------------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#      | inside Vim? | is Zoomed? | Action taken by key binding |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#      +-------------+------------+-----------------------------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#      | No          | No         | Focus directional tmux pane |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#      | No          | Yes        | Nothing: ignore key binding |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#      | Yes         | No         | Seamlessly focus Vim / tmux |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#      | Yes         | Yes        | Focus directional Vim split |
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#      +-------------+------------+-----------------------------+
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +vim_navigation_timeout=0.05 # number of seconds we give Vim to navigate
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +navigate='                                                             \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  pane_title="#{q:pane_title}";                                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  pane_current_command="#{q:pane_current_command}";                    \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  pane_is_zoomed() {                                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    test #{window_zoomed_flag} -eq 1;                                  \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  };                                                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  pane_title_changed() {                                               \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    test "$pane_title" != "$(tmux display -p "##{q:pane_title}")";     \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  };                                                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  command_is_vim() {                                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    case "${1%% *}" in                                                 \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      (vi|?vi|vim*|?vim*|view|?view|vi??*) true ;;                     \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      (*) false ;;                                                     \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    esac;                                                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  };                                                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  pane_contains_vim() {                                                \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    case "$pane_current_command" in                                    \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      (git|*sh) command_is_vim "$pane_title" ;;                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      (*) command_is_vim "$pane_current_command" ;;                    \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    esac;                                                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  };                                                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  pane_contains_neovim_terminal() {                                    \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    case "$pane_title" in                                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      (nvim?term://*) true ;;                                          \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      (*) false ;;                                                     \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    esac;                                                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  };                                                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  navigate() {                                                         \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    tmux_navigation_command=$1;                                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    vim_navigation_command=$2;                                         \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    vim_navigation_only_if=${3:-true};                                 \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    if pane_contains_vim && eval "$vim_navigation_only_if"; then       \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      if pane_contains_neovim_terminal; then                           \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +        tmux send-keys C-\\ C-n;                                       \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      fi;                                                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      eval "$vim_navigation_command";                                  \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      if ! pane_is_zoomed; then                                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +        sleep $vim_navigation_timeout; : wait for Vim to change title; \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +        if ! pane_title_changed; then                                  \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +          tmux send-keys BSpace;                                       \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +          eval "$tmux_navigation_command";                             \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +        fi;                                                            \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      fi;                                                              \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    elif ! pane_is_zoomed; then                                        \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      eval "$tmux_navigation_command";                                 \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    fi;                                                                \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  };                                                                   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +navigate '
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +navigate_left=" $navigate 'tmux select-pane -L'  'tmux send-keys C-w h'"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +navigate_down=" $navigate 'tmux select-pane -D'  'tmux send-keys C-w j'"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +navigate_up="   $navigate 'tmux select-pane -U'  'tmux send-keys C-w k'"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +navigate_right="$navigate 'tmux select-pane -R'  'tmux send-keys C-w l'"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +navigate_back=" $navigate 'tmux select-pane -l || tmux select-pane -t1'\
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +                          'tmux send-keys C-w p'                       \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +                          'pane_is_zoomed'                             "
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +# QWERTY keys - comment these out if you don't use QWERTY layout!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-h run-shell -b "$navigate_left"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-j run-shell -b "$navigate_down"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-k run-shell -b "$navigate_up"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-l run-shell -b "$navigate_right"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-\ run-shell -b "$navigate_back"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +# Dvorak keys - comment these out if you don't use Dvorak layout!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-d run-shell -b "$navigate_back"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-h run-shell -b "$navigate_left"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-t run-shell -b "$navigate_up"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-n run-shell -b "$navigate_down"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +bind-key -n M-s run-shell -b "$navigate_right"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Finally, adjust the key bindings and Vim navigation timeout per your situation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/tmux-yank-osc52.html b/tmux-yank-osc52.html new file mode 100644 index 0000000..9b6a892 --- /dev/null +++ b/tmux-yank-osc52.html @@ -0,0 +1,220 @@ +Copying to clipboard from tmux and Vim using OSC 52 - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Copying to clipboard from tmux and Vim using OSC 52

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Approach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. OSC 52 escapes (the new way)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Create a ~/bin/yank script
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Configure your ~/.tmux.conf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Configure your ~/.vimrc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            2. X11 forwarding (the old way)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Configure your ~/.tmux.conf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Configure your ~/.vimrc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              I switched to an Acer C720 chromebook as my primary computer +recently. However, its X11-based Aura desktop environment lacks X11 clipboard +integration, which prevents +me from using X11 forwarding to run the xsel(1) program as a means of copying and +pasting text between my system clipboard and programs running remotely in SSH. +So, I had to find a different solution for my copy/paste needs.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Approach

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In my search, I came across the OSC 52 escape sequence, +which tells the receiving terminal to copy some specified text into the user’s system clipboard.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              However, this escape sequence is only partially supported in the current stable +version of tmux (version 1.9a as of this writing), which limits the amount of +text that can be copied (per my observations) +to a meager 180 bytes!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              I reported this issue to +the tmux-users mailing list, where developer Nicholas Marriott quickly provided a +patch to +fix it. Armed with this patch, I distilled my working knowledge into a yank +script, integrated with tmux and Vim.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Now I can easily copy text from tmux and Vim running in any terminal session +(whether local, remote, or even nested therein!) without needing X11 +forwarding and having to keep environment variables like $DISPLAY and +$XAUTHORITY up to date! Finally, to paste text from the system clipboard into +a terminal session, I simply use the Control-Shift-V shortcut of the Secure +Shell terminal +emulator. And so, what began as a problem +led to the discovery of a superior solution! :-)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              OSC 52 escapes (the new way)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Create a ~/bin/yank script

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In ~/bin/yank file, which is also available on GitHub:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              #!/bin/sh
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# Usage: yank [FILE...]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# Copies the contents of the given files (or stdin, if no files are given) to
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# the terminal that runs this program.  If this program is run inside tmux(1),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# then it also copies the given contents into tmux's current clipboard buffer.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# If this program is run inside X11, then it also copies to the X11 clipboard.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# This is achieved by writing an OSC 52 escape sequence to the said terminal.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# The maximum length of an OSC 52 escape sequence is 100_000 bytes, of which
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# 7 bytes are occupied by a "\033]52;c;" header, 1 byte by a "\a" footer, and
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# 99_992 bytes by the base64-encoded result of 74_994 bytes of copyable text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# In other words, this program can only copy up to 74_994 bytes of its input.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# However, in such cases, this program tries to bypass the input length limit
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# by copying directly to the X11 clipboard if a $DISPLAY server is available;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# otherwise, it emits a warning (on stderr) about the number of bytes dropped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# NOTE: You might also need to allow this script to bypass tmux (through the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# "Ptmux;" escape sequence) by enabling allow-passthrough in your tmux.conf:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#   set-window-option -g allow-passthrough on
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# See http://en.wikipedia.org/wiki/Base64 for the 4*ceil(n/3) length formula.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# See http://sourceforge.net/p/tmux/mailman/message/32221257 for copy limits.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# See http://sourceforge.net/p/tmux/tmux-code/ci/a0295b4c2f6 for DCS in tmux.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# Written in 2014 by Suraj N. Kurapati <https://github.com/sunaku>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# Also documented at https://sunaku.github.io/tmux-yank-osc52.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +input=$( cat "$@" )
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +input() { printf %s "$input" ;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +known() { command -v "$1" >/dev/null ;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +maybe() { known "$1" && input | "$@" ;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +alive() { known "$1" && "$@" >/dev/null 2>&1 ;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# copy to tmux
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +test -n "$TMUX" && maybe tmux load-buffer -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# copy via X11
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +test -n "$DISPLAY" && alive xhost && {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  maybe xsel -i -b || maybe xclip -sel c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# copy via OSC 52
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +printf_escape() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  esc=$1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  test -n "$TMUX" -o -z "${TERM##screen*}" && esc="\033Ptmux;\033$esc\033\\"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  printf "$esc"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +len=$( input | wc -c ) max=74994
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +test $len -gt $max && echo "$0: input is $(( len - max )) bytes too long" >&2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +printf_escape "\033]52;c;$( input | head -c $max | base64 | tr -d '\r\n' )\a"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Configure your ~/.tmux.conf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              NOTE: See also my tmux.conf file template on GitHub for reference.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In ~/.tmux.conf file (if you are using tmux 3.3 or newer):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              # pass "Ptmux;" escape sequences through to the terminal
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +set-window-option -g allow-passthrough on
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In ~/.tmux.conf file (if you are using tmux 2.4 or newer):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              # transfer copied text to attached terminal with yank
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -T copy-mode-vi Y send-keys -X copy-pipe 'yank > #{pane_tty}'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# transfer most-recently copied text to attached terminal with yank
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -n M-y run-shell 'tmux save-buffer - | yank > #{pane_tty}'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# transfer previously copied text (chosen from a menu) to attached terminal
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -n M-Y choose-buffer 'run-shell "tmux save-buffer -b \"%%%\" - | yank > #{pane_tty}"'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In ~/.tmux.conf file (if you are using tmux 2.3 or older):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              # transfer copied text to attached terminal with yank
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -t vi-copy y copy-pipe 'yank > #{pane_tty}'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# transfer copied text to attached terminal with yank
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -n M-y run-shell 'tmux save-buffer - | yank > #{pane_tty}'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# transfer previously copied text (chosen from a menu) to attached terminal
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -n M-Y choose-buffer 'run-shell "tmux save-buffer -b \"%%\" - | yank > #{pane_tty}"'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Configure your ~/.vimrc

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In ~/.vimrc file:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              " copy to attached terminal using the yank(1) script:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +" https://github.com/sunaku/home/blob/master/bin/yank
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function! Yank(text) abort
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  let escape = system('yank', a:text)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  if v:shell_error
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    echoerr escape
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  else
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    call writefile([escape], '/dev/tty', 'b')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  endif
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +endfunction
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +noremap <silent> <Leader>y y:<C-U>call Yank(@0)<CR>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +" automatically run yank(1) whenever yanking in Vim
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +" (this snippet was contributed by Larry Sanderson)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function! CopyYank() abort
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +  call Yank(join(v:event.regcontents, "\n"))
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +endfunction
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +autocmd TextYankPost * call CopyYank()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              X11 forwarding (the old way)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The disadvantage of this X11 forwarding solution is that you need to run SSH with +the -X or -Y options while also keeping environment variables like +$DISPLAY and $XAUTHORITY up to date as you disconnect and reconnect your +remote sessions.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Configure your ~/.tmux.conf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In ~/.tmux.conf file:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              # transfer copied text to X primary selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -n M-y run-shell 'tmux save-buffer - | xsel -p -i'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# transfer copied text to X clipboard selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -n M-Y run-shell 'tmux save-buffer - | xsel -b -i'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# paste X primary selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -n M-p run-shell 'xsel -p -o | tmux load-buffer - \; paste-buffer \; delete-buffer'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +# paste X clipboard selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bind-key -n M-P run-shell 'xsel -b -o | tmux load-buffer - \; paste-buffer \; delete-buffer'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Configure your ~/.vimrc

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              In ~/.vimrc file:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              " copy to primary selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +noremap <Leader>y "*y
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +" copy to clipboard selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +noremap <Leader>Y "+y
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +" paste from primary selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +noremap <Leader>p "*p
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +" paste from clipboard selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +noremap <Leader>P "+p
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/tomorrow-terminal-color-scheme.html b/tomorrow-terminal-color-scheme.html new file mode 100644 index 0000000..0e1a146 --- /dev/null +++ b/tomorrow-terminal-color-scheme.html @@ -0,0 +1,140 @@ +Tomorrow terminal color scheme - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Tomorrow terminal color scheme

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              I took the TomorrowNight and TomorrowNightEighties terminal color +schemes from Chris Kempson’s Tomorrow theme and remixed them, +per my taste, for visual harmony and readability in dark hours. Behold!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              the color scheme +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              UNIX manual page +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              To use this color scheme in hterm, open the nassh extension’s settings page, +open Chrome Developer Tools, and then run the following snippet in the console:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              term_.prefs_.set("background-color", "#2d2d2d");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +term_.prefs_.set("foreground-color", "#cccccc");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +term_.prefs_.set("cursor-color", "rgba(174,175,173, 0.5)"); /* #aeafad */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +term_.prefs_.set("color-palette-overrides", ["#000000", "#f2777a", "#99cc99",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +"#de935f", "#81a2be", "#cc99cc", "#94CCCC", "#515151", "#666666", "#f2777a",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +"#99cc99", "#f0c674", "#81a2be", "#cc99cc", "#94CCCC", "#393939"]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              To use this color scheme in Rxvt or XTerm, save the following snippet to a file +such as ~/.Xdefaults and then run xrdb -merge on that file to apply it. Any +terminals launched thereafter will use this color scheme, but not existing ones.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ! BLK
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color0        #000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color8        #1d1f21
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! RED
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNightEighties.t_red
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color1        #f2777a
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color9        _color1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! GRN
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNightEighties.t_green
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color2        #99cc99
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color10       _color2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! YEL
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNight.t_yellow
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color3        #f0c674
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color11       _color3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! BLU
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNight.t_blue
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color4        #81a2be
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color12       _color4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! MAG
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNightEighties.t_purple
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color5        #cc99cc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color13       _color5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! CYN
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNightEighties.t_aqua(hue,value) + TomorrowNight.t_aqua(saturation)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color6        #94CCCC
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color14       _color6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! WHT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNightEighties.t_selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color7        #dadada
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNightEighties.t_current_line
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _color15       #e4e4e4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! FMT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _colorBD       _color11
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _colorUL       _color6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TXT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNightEighties.t_foreground
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _foreground    #cccccc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! TomorrowNightEighties.t_background
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _background    #2d2d2d
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#define _cursorColor   #aeafad
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color0         : _color0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color1         : _color1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color2         : _color2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color3         : _color3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color4         : _color4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color5         : _color5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color6         : _color6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color7         : _color7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color8         : _color8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color9         : _color9
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color10        : _color10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color11        : _color11
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color12        : _color12
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color13        : _color13
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color14        : _color14
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*color15        : _color15
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*colorBD        : _colorBD
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*colorIT        : _colorIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*colorUL        : _colorUL
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*foreground     : _foreground
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*background     : _background
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +URxvt*cursorColor    : _cursorColor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color0         : _color0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color1         : _color1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color2         : _color2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color3         : _color3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color4         : _color4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color5         : _color5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color6         : _color6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color7         : _color7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color8         : _color8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color9         : _color9
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color10        : _color10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color11        : _color11
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color12        : _color12
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color13        : _color13
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color14        : _color14
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*color15        : _color15
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*colorBD        : _colorBD
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*colorIT        : _colorIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*colorUL        : _colorUL
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*foreground     : _foreground
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*background     : _background
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*cursorColor    : _cursorColor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +! enable coloring for bold and underlined text
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*vt100.boldColors     : False
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*vt100.colorBDMode    : True
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*vt100.colorULMode    : True
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*vt100.colorRVMode    : False
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +XTerm*vt100.veryBoldColors : 6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/using-telugu-in-ubuntu-linux.html b/using-telugu-in-ubuntu-linux.html new file mode 100644 index 0000000..5c93586 --- /dev/null +++ b/using-telugu-in-ubuntu-linux.html @@ -0,0 +1,143 @@ +How to use Telugu in Ubuntu Linux - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              How to use Telugu in Ubuntu Linux

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Correcting Telugu text rendering
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Ubuntu Gutsy Gibbon 7.10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Ubuntu Feisty Fawn 7.4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Ubuntu Dapper Drake 6.4 and Edgy Eft 6.10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Ubuntu Breezy Badger 5.10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      2. Enlarging Telugu text
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Typing in Telugu with SCIM

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          This is a guide to setting up Telugu on Ubuntu Linux. I have also written some +of this information at the Ubuntu +wiki the Swecha +wiki, and Wikipedia.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Correcting Telugu text rendering

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The rendering of Telugu text is broken by default if you specify a non-Telugu +locale, such as “en_us” (English, United States), when you install Ubuntu. +Fortunately, this problem is solvable – as the following sections illustrate.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Ubuntu Gutsy Gibbon 7.10

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          This version of Ubuntu finally fixes the rendering of Telugu text in non- +Telugu locales! Hurray! :-)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          However, it uses Vemana2000 (which is rather cartoonish and unreadable in my +opinion) as the default font for rendering Telugu text. To fix this, we can +install the (much more legible) Pothana2000 font by running the following +command:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          sudo apt-get install ttf-telugu-fonts
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Afterwards, any newly started programs will use Pothana2000 instead of +Vemana2000 to render Telugu text.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Ubuntu Feisty Fawn 7.4

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Install Telugu fonts:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo apt-get install language-pack-te language-support-te
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. As Sunil Mohan suggests, create a file named .fonts.conf inside your home directory and populate it with the following content:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <?xml version="1.0"?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +<fontconfig>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + <alias>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  <family>sans-serif</family>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  <prefer>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +   <family>Pothana2000</family>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  </prefer>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + </alias>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + <alias>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  <family>serif</family>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  <prefer>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +   <family>Pothana2000</family>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  </prefer>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + </alias>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + <alias>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  <family>monospace</family>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  <prefer>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +   <family>Pothana2000</family>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +  </prefer>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + </alias>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +</fontconfig>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          5. Reload your system’s font configuration:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            fc-cache
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Ubuntu Dapper Drake 6.4 and Edgy Eft 6.10

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Install Telugu fonts:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo apt-get install language-pack-te language-support-te
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. Apply the temporary solution for the fonts.cache-1 bug:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo sed -i.orig 's/lang=:/lang=te:/g' \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +/usr/share/fonts/truetype/ttf-telugu-fonts/fonts.cache-1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          5. Reload your system’s font configuration:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            fc-cache
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            This is a temporary solution because when you install new fonts or update +existing fonts, all the fonts.cache-1 files will be regenerated. So if you +ever see incorrectly rendered Telugu text again, simply reapply the above +solution.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Ubuntu Breezy Badger 5.10

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Install Telugu fonts:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo apt-get install ttf-indic-fonts
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. As Soumyadip Modak suggests, remove the ttf-freefont package:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo apt-get remove ttf-freefont
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Enlarging Telugu text

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Pothana2000 is difficult to read because it appears much smaller than English +text at the same font-size. For example, compare the relative size of the +number “1925” and its surrounding Telugu text in these screenshots:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Default Pothana2000 beside English text. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          137% Pothana2000 beside English text. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I often attempted to enlarge Pothana2000 by editing +fontconfig configuration files, but +never succeeded. In this manner, I struggled with tiny, nearly illegible +Telugu text for two years. In fact, I would avoid using Telugu altogether, for +months at a time, after becoming frustrated with this problem.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          However, with the help of Rahul +Bhalerao, I +was finally able to enlarge Pothana2000 to a readable size. In fact, I ended +up making Pothana2000 slightly larger than English text at the same font-size +because Telugu text has a greater variation of ascent and +descent than English text.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Without further adieu, here are the instructions for enlarging Pothana2000, or +any font in general:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Install the FontForge program:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo apt-get install fontforge
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. Open Pothana2000 with FontForge for editing:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            fontforge /usr/share/fonts/truetype/ttf-telugu-fonts/Pothana2000.ttf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          5. When a dialog window appears, asking if you have permission to edit the font, choose yes – we have legal permission to edit the font because Pothana2000 is released under the GPL.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          7. Choose Edit -> Select -> Select All from the main menu. All glyphs should be selected now.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          9. Choose Element -> Transformations -> Transform from the main menu. A dialog window will now appear.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            FontForge dialog window +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Choose Glyph Origin from the first menu.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            3. Choose Scale Uniformly… from the second menu and enter your desired scaling factor (I prefer 137%).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            5. Tick all boxes, as shown in the screenshot above.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            7. Press the OK button.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            9. Choose File -> Generate Fonts… from the main menu and save the file as a TrueType (.ttf) font.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          11. Replace the system’s Pothana2000 font with the newly generated one:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo cp -vb newly-generated-font.ttf /usr/share/fonts/truetype/ttf-telugu-fonts/Pothana2000.ttf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          From now on, any new programs that you run should render Telugu text with +the new, enlarged font. However, you may want to restart your X session just +in case some programs do not recognize that we just updated Pothana2000.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Typing in Telugu with SCIM

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +Telugu RTS with SCIM in Ubuntu Breezy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          See this related article for instructions on +setting up Telugu RTS with SCIM, as demonstrated in the video above.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/vegan-for-life.html b/vegan-for-life.html new file mode 100644 index 0000000..0d49755 --- /dev/null +++ b/vegan-for-life.html @@ -0,0 +1,1550 @@ +Vegan: Healthy, Sustainable, Compassionate Living - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Vegan: Healthy, Sustainable, Compassionate Living

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Healthy, Sustainable, and Compassionate living is best achieved by being +Vegan since it reverses top diseases +while sparing animals and saving our planet too!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          To share this page with others, you can use is.gd/oyadad +as a permanent link. Also, see my cloud storage at +is.gd/cahiwi for even more educational materials.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Introduction
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. What is Vegan?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Why be Vegan?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              2. Healthy living
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. By doctor's orders
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. To fight diseases
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Heart disease
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Cancer
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Diabetes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Kidney disease
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. High blood pressure
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            2. To boost nutrition
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Don't we need meat?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Don't we need milk?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Don't we need eggs?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Don't we need fish?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Won't we lose protein?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Won't we become weak?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. What about children?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. What about the elderly?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            2. To detox pollutants
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            3. Sustainable living
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. To fight pollution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. To secure our future
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. Compassionate living
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. To bear witness
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Where meat comes from
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Where milk comes from
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Where eggs come from
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Where fish comes from
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. To understand why
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Logic and fallacy
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. How do I get started?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Take a challenge!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Kickstart your health
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. India 21-day kickstart
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. Food alternatives
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. International flavors
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Meat alternatives
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Milk alternatives
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Egg alternatives
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Fish alternatives
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Sweets alternatives
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            2. Other alternatives
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Dawning a new era
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Want to learn more?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Introduction

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                A year and a half ago, I learned that virtually all meat, dairy, and eggs +come from nightmarish concentration camps of suffering +known as Factory Farms, which are a far cry from the mythical Old MacDonald’s +Farm we were taught as children.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “No matter how far you go down the wrong road, always turn back.” — +Turkish proverb

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                It was a tsunami of visceral revulsion and karmic overload to witness the +inhuman suffering enacted incessantly by animal agriculture on our +behalf. By what perversion did this become the status +quo?! Justly appalled, I went Vegan overnight +and my family soon joined as I shared my newfound knowledge with them.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “Veganism is a way of living which seeks to exclude, as far as is possible and +practicable, all forms of exploitation of, and cruelty to, animals for food, +clothing or any other purpose.” — Definition

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                However, neither the ethical merits nor the +environmental benefits of being Vegan were able to +sway most other people enough to even consider the +issues at hand, let alone to be Vegan themselves. +Some showed interest, but hesitated over unfounded worries of inadequate +nutrition damaging their current health +because they believed that only meat and dairy could provide their +essential nutrients.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                What I needed was an authoritative, scientific body of evidence to dispel +their fears and draw interest from even those who ask “What’s in it for +me?”. Luckily this year, I found just what the doctor ordered: +evidence-based medical and nutritional +justification for every man, woman, and child to +become Vegan!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                So here I am, writing this article in order to spread awareness about this +non-obvious and empowering knowledge so that we may all change for the +better. My only regret is not knowing sooner: alas, we were +blindfolded, but nevermore!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “You assist an evil system most effectively by obeying its orders and +decrees. An evil system never deserves such allegiance. Allegiance to +it means partaking of the evil. A good person will resist an evil +system with his or her whole soul.” — Mahatma Gandhi

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Thanks for your open-minded attention and thoughtful consideration on +behalf of your future self, our fellow sentient beings, and our one and +only planet Earth.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                What is Vegan?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “Veganism is a way of living which seeks to exclude, as far as is possible and +practicable, all forms of exploitation of, and cruelty to, animals for food, +clothing or any other purpose.” — Definition

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Ve(ga)nn Diagram" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"It takes courage to speak up for your rights... and compassion to speak up for all beings." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Why be Vegan?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Philip Wollen eloquently introduces the major +issues surrounding animal agriculture in a debate (which his team won, with +73.6% votes in favor!) about +removing animal products from restaurant menus in Melbourne, Australia in 2012:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Emily Moran Barwick introduces the ethical, +environmental, and health consequences of animal product creation & consumption, +with sources cited here:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                See also this news article in The Huffington Post for an +excellent introduction.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan for Everything" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Healthy living

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                By doctor’s orders

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The largest U.S. healthcare organization, Kaiser Permanente, officially +recommends a whole-food plant-based diet to all +their patients and doctors too:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +What Diet Should Physicians Recommend? — +Kaiser Permanente, the largest U.S. managed care organization, publishes patient education materials to help make plant-based diets the “new normal” for patients and physicians.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Today’s unhealthy food habits are socially accepted just like cigarette smoking +was back in the 1950’s! So just don’t wait until your doctor “kicks the habit”:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Don’t Wait Until Your Doctor Kicks the Habit — +Just like most doctors smoked in the 1950s, most physicians today continue to consume foods that are contributing to our epidemics of dietary disease.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To fight diseases

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dr. Michael Greger explains that you can prevent, treat, and even reverse our +topmost killer diseases by eating a whole-food plant-based vegan diet as +discussed in both his NYT best-selling book +and associated lectures on Uprooting the Leading Causes of Death as well +as How Not To Die, with +sources cited here:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Uprooting the Leading Causes of Death — +Death in America is largely a foodborne illness. Focusing on studies published just over the last year in peer-reviewed scientific medical journals, Dr. Greger offers practical advice on how best to feed ourselves and our families to prevent, treat, and even reverse many of the top 15 killers in the United States.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +HOW NOT TO DIE: The Role of Diet in Preventing, Arresting, & Reversing Our Top 15 Killers — +In this “best-of” compilation of his last four year-in-review presentations, Dr. Greger explains what we can do about the #1 cause of death and disability: our diet.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                RankCause of DeathPreventable?Treatable?Reversible?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1Heart diseasesYesYesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2Cancer (malignant neoplasms)YesYesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3Lung (chronic lower respiratory) diseasesYesYesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4Stroke (cerebrovascular diseases)Yes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5Accidents (unintentional injuries)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6Doctors (prescription side-effects)Yes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7Alzheimer’s diseaseYesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8DiabetesYesYesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9Kidney failure (nephritis and nephrotic syndrome)YesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                10Influenza and pneumoniaYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                11Suicide (intentional self-harm)YesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                12Blood infection (septicemia)Yes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                13Chronic liver disease and cirrhosisYesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                14High blood pressure (essential hypertension)YesYesYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                15Parkinson’s diseaseYes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                16Lung tissue inflammation (pneumonitis)Yes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Heart disease

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +How Not to Die from Heart Disease — +Lifestyle approaches aren’t just safer and cheaper. They can work better, because you’re treating the actual cause of the disease.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Making Heart Attacks History: Dr. Caldwell Esselstyn at TEDxCambridge 2011

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Paul Chatlin: eating plant-based saved him from surgery (former meat lover heals heart with plant-based diet in the H.O.P.E. Project.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Heart attack with extra cheese, heart attack with bacon, double bypass no pickles, --hey! Where's my diabetes and large stroke?" by Bizarro +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Cholesterol & Lower Back Pain — +High cholesterol can lead to atherosclerosis in the vertebral arteries that nourish our spine, and result in disc degeneration and lower back pain—a leading cause of disability.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Back in Circulation: Sciatica & Cholesterol — +Atherosclerotic plaque clogging the arteries feeding our spine may lead to low back pain, disc degeneration, and sciatic nerve irritation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Survival of the Firmest: Erectile Dysfunction & Death — +Because penile arteries are only about half the size of the coronary arteries in the heart, erectile dysfunction can be a powerful predictor of cardiac events—such as sudden death.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Cancer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. The Physicians Committee’s Food Choices for Cancer Prevention and Survival + +"Food Choices for Cancer Prevention and Survival" guide by Physicians Committee for Responsible Medicine +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Nutrition Facts survey of actionable findings from Breast Cancer research

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. Nutrition Facts summary of actionable findings from general Cancer research

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +How Not to Die from Cancer — +What happens when you put cancer on a plant-based diet?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Which Dietary Factors Affect Breast Cancer Most? — +American Institute for Cancer Research recommendation compliance associated not only with cancer prevention and survival but less heart and respiratory disease mortality and a longer lifespan.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +The Best Advice on Diet and Cancer — +What the best available balance of evidence says right now about what to eat and avoid to reduce your risk of cancer.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +D Anthony Evans: a cancer patient given 6 months to live becomes a Cancer Thriver who defies his prognosis, in the H.O.P.E. Project.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Diabetes

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Plant-Based Diets Recognized by Diabetes Associations — +Plant-based diets as the single most important, yet underutilized, opportunity to reverse the pending obesity and diabetes-induced epidemic of disease and death.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +What Causes Insulin Resistance? — +Prediabetes and type 2 diabetes are caused by a drop in insulin sensitivity blamed on “intramyocellular lipid,” the buildup of fat inside our muscle cells.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Tackling diabetes with a bold new dietary approach: Dr. Neal Barnard at TEDxFremont 2012

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +How Not to Die from Diabetes — +Type 2 diabetes can be prevented, arrested, and even reversed with a healthy enough diet.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Marc Ramirez: reversed Diabetes and Erectile Dysfunction with diet while saving thousands of dollars eating this way, in the H.O.P.E. Project.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Which treatment would you prefer to control Type 2 Diabetes?" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Go Vegan! explains how nutrition affects diabetes, with sources cited below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. IDF - 2015 Diabetes Atla.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Ley, S. H., et al. (2014). Prevention and management of type 2 +diabetes: dietary components and nutritional strategies. Lancet +383(9933): 1999-2007.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. Davis, Brenda (2008). Defeating Diabetes: Lessons From the Marshall +Islands. Today’s Dietitian. Vol. 10 No. 8 P. 24

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7. Chiu, T. H., et al. (2014). Taiwanese vegetarians and omnivores: +dietary composition, prevalence of diabetes and IFG. PLoS One 9(2): +e88547.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9. Tonstad, S., et al. (2013). Vegetarian diets and incidence of diabetes +in the Adventist Health Study-2. Nutr Metab Cardiovasc Dis 23(4): +292-299.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                11. Barnard, N. D., et al. (2006). A low-fat vegan diet improves glycemic +control and cardiovascular risk factors in a randomized clinical trial +in individuals with type 2 diabetes. Diabetes Care 29(8): 1777-1783.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                13. Ornish, D., et al. (1990). Can lifestyle changes reverse coronary +heart disease? The Lifestyle Heart Trial. Lancet 336(8708): 129-133.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                15. Kahleova, H. and T. Pelikanova (2015). Vegetarian Diets in the +Prevention and Treatment of Type 2 Diabetes. J Am Coll Nutr 34(5): +448-458.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                16. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Kidney disease

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +How Not to Die from Kidney Disease — +What are the three significant dietary risk factors for declining kidney function?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                High blood pressure

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +How Not to Die from High Blood Pressure — +How to prevent and reverse hypertension, the #1 risk factor for death in the world.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Dr. Kim Williams, president of the American College of Cardiologists" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To boost nutrition

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The Academy of Nutrition and Dietetics, who are the world’s +largest organization of food and nutrition professionals, published their +official position on this matter in Volume +116, Issue 12, Pages 1970-1980 (December 2016), stating that:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “It is the position of the Academy of Nutrition and Dietetics that +appropriately planned vegetarian, including vegan, diets are healthful, +nutritionally adequate and may provide health benefits for the +prevention and treatment of certain diseases. + These diets are appropriate for all stages of the life cycle, +including pregnancy, lactation, infancy, childhood, adolescence, older +adulthood and for athletes. + Vegans need reliable sources of vitamin B-12, such as fortified foods +or supplements.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Which would you rather take?" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Regarding their Vitamin B-12 statement: you only need a single 2500mcg +vitamin B-12 supplement once per week, which can +cost as little as $2 per year!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +The Great Protein Fiasco — +The field of nutrition got human protein requirements spectacularly wrong, leading to a massive recalculation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +The Food Industry Wants the Public Confused About Nutrition — +The “Fairness Doctrine” example shows to what extent the purveyors of unhealthy products will go to keep the truth from the American public.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"People eat in color." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Your stomach after two different meals." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegans don't need laxatives: Fiber is our friend." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Don’t we need meat?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Harvard’s Meat & Mortality Studies — +The Harvard Health Professionals Follow-up Study and the Harvard Nurses’ Health Study concluded that red meat consumption was associated with living a significantly shorter life—increased cancer mortality, increased heart disease mortality, and increased overall mortality.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Carnitine, Choline, Cancer, & Cholesterol: The TMAO Connection — +The New England Journal of Medicine shows that choline in eggs, poultry, dairy, and fish produces the same toxic TMAO as carnitine in red meat—which may help explain plant-based protection from heart disease and prostate cancer.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Go Vegan! illuminates the health risks of eating meat, with sources cited below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. 103年國人死因統計結果。台灣衛生福利部。 +http://www.mohw.gov.tw/news/531349778

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Huang T, Yang B, Zheng J, Li G, Wahlqvist ML, Li D. Cardiovascular +disease mortality and cancer incidence in vegetarians: a meta-analysis +and systematic review. Ann Nutr Metab. 2012;60(4):233-40. doi: +10.1159/000337301. Epub 2012 Jun 1. Review. PubMed PMID: 22677895. +https://doi.org/10.1159/000337301

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. Ma X, Park Y, Mayne ST, Wang R, Sinha R, Hollenbeck AR, Schatzkin A, +Cross AJ. Diet, lifestyle, and acute myeloid leukemia in the NIH-AARP +cohort. Am J Epidemiol. 2010 Feb 1;171(3):312-22.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7. Cho E, Spiegelman D, Hunter DJ, Chen WY, Stampfer MJ, Colditz GA, +Willett WC. Premenopausal fat intake and risk of breast cancer. J Natl +Cancer Inst. 2003 Jul 16;95(14):1079-85.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9. Otsuki M, Tashiro M. 4. Chronic pancreatitis and pancreatic cancer, +lifestyle-related diseases. Intern Med. 2007;46(2):109-13. Epub 2007 +Jan 15. Review.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                11. Bouvard V, Loomis D, Guyton KZ, Grosse Y, Ghissassi FE, +Benbrahim-Tallaa L, Guha N, Mattock H, Straif K; International Agency +for Research on Cancer Monograph Working Group. Carcinogenicity of +consumption of red and processed meat. Lancet Oncol. 2015 +Dec;16(16):1599-600.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                13. Pan A, Sun Q, Bernstein AM, Schulze MB, Manson JE, Stampfer MJ, Willett +WC, Hu FB. Red meat consumption and mortality: results from 2 +prospective cohort studies. Arch Intern Med. 2012 Apr 9;172(7):555-63.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                15. Appleby PN, Thorogood M, Mann JI, Key TJ. The Oxford Vegetarian Study: +an overview. Am J Clin Nutr. 1999 Sep;70(3 Suppl):525S-531S. PubMed +PMID: 10479226.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                16. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                17. Thompson IM, Tangen CM, Goodman PJ, Probstfield JL, Moinpour CM, +Coltman CA. Erectile dysfunction and subsequent cardiovascular +disease. JAMA. 2005 Dec 21;294(23):2996-3002.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                18. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Pay up, or Tony 'Chest Pain' Proscuitto is gonna fill you with fat and cholesterol." by Bizarro +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Don’t we need milk?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                See what these Olympic athletes have to say in response to this common question:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dairy consumption causes acne, +allergies, +colic, +and constipation +as well as serious issues like +prostate cancer, +type-1 diabetes, +infertility, +and more.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Is Milk Good for Our Bones? — +The galactose in milk may explain why milk consumption is associated with significantly higher risk of hip fractures, cancer, and premature death.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Dairy Estrogen & Male Fertility — +Sex steroid hormones in meat, eggs, and dairy may help explain the link between saturated fat intake and declining sperm counts.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Dr. Neal Barnard presents The Cheese Trap: How breaking a surprising addiction can revolutionize your health.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"You don't need dairy to get Calcium." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Go Vegan! explains that humans don’t need cow’s milk, with sources cited below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Michaëlsson K, Wolk A, Langenskiöld S, Basu S, Warensjö Lemming E, +Melhus H, Byberg L. Milk intake and risk of mortality and fractures in +women and men: cohort studies. BMJ. 2014 Oct 28;349:g6015.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Feskanich D, Bischoff-Ferrari HA, Frazier AL, Willett WC. Milk +consumption during teenage years and risk of hip fractures in older +adults. JAMA Pediatr. 2014 Jan;168(1):54-60. doi: +10.1001/jamapediatrics.2013.3821. https://doi.org/10.1001/jamapediatrics.2013.3821

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. Bolland MJ, Leung W, Tai V, Bastin S, Gamble GD, Grey A, Reid IR. +Calcium intake and risk of fracture: systematic review. BMJ. 2015 Sep +29;351:h4580. doi:10.1136/bmj.h4580. Review. https://doi.org/10.1136/bmj.h4580

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7. Bischoff-Ferrari HA, Dawson-Hughes B, Baron JA, Kanis JA, Orav EJ, +Staehelin HB, Kiel DP, Burckhardt P, Henschkowski J, Spiegelman D, Li +R, Wong JB, Feskanich D, Willett WC. Milk intake and risk of hip +fracture in men and women: a meta-analysis of prospective cohort +studies. J Bone Miner Res. 2011 Apr;26(4):833-9.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9. Hao L, Huang H, Gao J, Marshall C, Chen Y, Xiao M. The influence of +gender, age and treatment time on brain oxidative stress and memory +impairment induced by d-galactose in mice. Neurosci Lett +2014;571C:45-9.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                11. Cui X, Wang L, Zuo P, Han Z, Fang Z, Li W, et al. D-galactose caused +life shortening in Drosophila melanogaster and Musca domestica is +associated with oxidative stress. Biogerontology 2004;5:317-25.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                13. Cao Y, Nimptsch K, Shui IM, Platz EA, Wu K, Pollak MN, Kenfield SA, +Stampfer MJ, Giovannucci EL. Prediagnostic plasma IGFBP-1, IGF-1 and +risk of prostate cancer. Int J Cancer. 2015 May 15;136(10):2418-26. +doi: 10.1002/ijc.29295. Epub 2014 Nov 10. https://doi.org/10.1002/ijc.29295

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                15. Ma J, Giovannucci E, Pollak M, Chan JM, Gaziano JM, Willett WC, +Stampfer MJ. Milk intake, circulating levels of insulin-like growth +factor-I, and risk of colorectal cancer in men. J Natl Cancer Inst +2001; 93:1330–6.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                16. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                17. Qin LQ, He K, Xu JY. Milk consumption and circulating insulin-like +growth factor-I level: a systematic literature review. Int J Food Sci +Nutr 2009;60(Suppl 7):330–40.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                18. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                19. Allen NE, Appleby PN, Davey GK, Key TJ. Hormones and diet: low +insulin-like growth factor-I but normal bioavailable androgens in +vegan men. Br J Cancer 2000;83:95–7.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                20. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                21. Aune D, Navarro Rosenblatt DA, Chan DS, Vieira AR, Vieira R, Greenwood +DC, Vatten LJ, Norat T. Dairy products, calcium, and prostate cancer +risk: a systematic review and meta-analysis of cohort studies. Am J +Clin Nutr. 2015 Jan;101(1):87-117.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                22. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                23. Andiran F, Dayi S, Mete E. Cows milk consumption in constipation and +anal fissure in infants and young children. J Paediatr Child Health. +2003 Jul;39(5):329-31.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                24. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                25. Irastorza I, Ibañez B, Delgado-Sanzonetti L, Maruri N, Vitoria JC. +Cow’s-milk-free diet as a therapeutic option in childhood chronic +constipation. J Pediatr Gastroenterol Nutr. 2010 Aug;51(2):171-6.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                26. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                27. Carroccio A, Mansueto P, Morfino G, D'Alcamo A, Di Paola V, Iacono G, +Soresi M, Scerrino G, Maresi E, Gulotta G, Rini G, Bonventre S. +Oligo-antigenic diet in the treatment of chronic anal fissures. +Evidence for a relationship between food hypersensitivity and anal +fissures. Am J Gastroenterol. 2013 May;108(5):825-32.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                28. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                29. Dehghani SM, Ahmadpour B, Haghighat M, Kashef S, Imanieh MH, Soleimani +M. The Role of Cow’s Milk Allergy in Pediatric Chronic Constipation: A +Randomized Clinical Trial. Iran J Pediatr. 2012 Dec;22(4):468-74.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                30. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                31. Melnik BC. Evidence for acne-promoting effects of milk and other +insulinotropic dairy products. Nestle Nutr Workshop Ser Pediatr +Program. 2011;67:131-45.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                32. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                33. Weaver CM, Plawecki KL. Dietary calcium: adequacy of a vegetarian +diet. Am J Clin Nutr. 1994 May;59(5 Suppl):1238S-1241S. Review.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                34. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                35. Weaver CM, Proulx WR, Heaney R. Choices for achieving adequate dietary +calcium with a vegetarian diet. Am J Clin Nutr. 1999 Sep;70(3 +Suppl):543S-548S. Review.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                36. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                37. Food and Agriculture Organization of the United Nations: Climate +Emissions +http://www.fao.org/agriculture/lead/themes0/climate/emissions/en/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                38. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"We feel really guilty. The fat in beef & dairy is killing you people by the millions. We think it would be best if we went our separate ways." by Bizarro +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Don’t we need eggs?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Eggs vs. Cigarettes in Atherosclerosis — +A similar exponential increase in carotid artery plaque buildup was found for smokers and egg eaters.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Who Says Eggs Aren’t Healthy or Safe? — +Freedom of Information Act documents reveal that the U.S. Department of Agriculture warned the egg industry that saying eggs are nutritious or safe may violate rules against false and misleading advertising.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Don’t we need fish?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Is Fish Oil Just Snake Oil? — +Advice to eat oily fish, or take fish oil, to lower risk of heart disease, stroke, or mortality is no longer supported by the balance of available evidence.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +How Long to Detox from Fish before Pregnancy? — +How many months does it take to clear 99% of the mercury and other industrial toxins from one’s body, and what role might our fat stores play in holding on to fat-soluble pollutants?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Dioxins in U.S. Farm-Raised Catfish — +Feed contaminated with toxic pollutants thought to originate from sewer sludge fed to chickens and fish results in human dioxin exposure through poultry, eggs, and catfish.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Won’t we lose protein?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +The Great Protein Fiasco — +The field of nutrition got human protein requirements spectacularly wrong, leading to a massive recalculation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"There are many excellent sources of Vegan protein" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Go Vegan! explains that plants give you protein too, with sources cited +below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Dietary Reference Intakes (DRIs): Macronutrients +http://nationalacademies.org/hmd/activities/nutrition/drimacronutrients.aspx

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Messina V. Nutritional and health benefits of dried beans. Am J Clin +Nutr. 2014 Jul;100 Suppl 1:437S-42S. doi: 10.3945/ajcn.113.071472. Epub +2014 May 28. https://doi.org/10.3945/ajcn.113.071472

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. Teng GG, Pan A, Yuan JM, Koh WP. Food Sources of Protein and Risk of +Incident Gout in the Singapore Chinese Health Study. Arthritis +Rheumatol. 2015 Jul;67(7):1933-42. doi: 10.1002/art.39115. +https://doi.org/10.1002/art.39115

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7. Choi HK, Atkinson K, Karlson EW, Willett W, Curhan G. Purine-rich +foods, dairy and protein intake, and the risk of gout in men. N Engl J +Med. 2004 Mar 11;350(11):1093-103.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9. Messina M, Messina VL, Chan P. Soyfoods, hyperuricemia and gout: a +review of the epidemiologic and clinical data. Asia Pac J Clin Nutr. +2011;20(3):347-58. Review.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                11. Yamakita J, Yamamoto T, Moriwaki Y, Takahashi S, Tsutsumi Z, Higashino +K. Effect of Tofu (bean curd) ingestion and on uric acid metabolism in +healthy and gouty subjects. Adv Exp Med Biol. 1998;431:839-42.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                13. Caan BJ, Natarajan L, Parker B et al. (2011) Soy food consumption and +breast cancer prognosis. Cancer epidemiology, biomarkers & prevention: +a publication of the American Association for Cancer Research, +cosponsored by the American Society of Preventive Oncology 20, 854-858.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                15. Doyle C, Kushi LH, Byers T et al. (2006) Nutrition and physical +activity during and after cancer treatment: an American Cancer Society +guide for informed choices. CA: a cancer journal for clinicians 56, +323-353.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                16. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                17. Guha N, Kwan ML, Quesenberry CP, Jr. et al. (2009) Soy isoflavones and +risk of cancer recurrence in a cohort of breast cancer survivors: the +Life After Cancer Epidemiology study. Breast cancer research and +treatment 118, 395-405.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                18. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                19. Hsieh CY, Santell RC, Haslam SZ et al. (1998) Estrogenic effects of +genistein on the growth of estrogen receptor-positive human breast +cancer (MCF-7) cells in vitro and in vivo. Cancer research 58, +3833-3838.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                20. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                21. Rock CL, Doyle C, Demark-Wahnefried W et al. (2012) Nutrition and +physical activity guidelines for cancer survivors. CA: a cancer +journal for clinicians 62, 243-274.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                22. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                23. Setchell KD, Brown NM, Zhao X et al. (2011) Soy isoflavone phase II +metabolism differs between rodents and humans: implications for the +effect on breast cancer risk. The American journal of clinical +nutrition 94, 1284-1294.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                24. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                25. Shu XO, Zheng Y, Cai H et al. (2009) Soy food intake and breast +cancer survival. Jama 302, 2437-2443.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                26. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                27. Ruini LF, Ciati R, Pratesi CA, Marino M, Principato L, Vannuzzi E. +Working toward Healthy and Sustainable Diets: The “Double Pyramid +Model” Developed by the Barilla Center for Food and Nutrition to Raise +Awareness about the Environmental and Nutritional Impact of Foods. +Front Nutr. 2015 May 4;29.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                28. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"No meat at all? Are you sure you're getting enough protein?" by Bizarro +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Won’t we become weak?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Go Vegan! dispels the notion that Vegans become weak, with sources cited +below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Olympic vegetarians: the elite athletes who shun meat +http://goo.gl/J8GgkL

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Fuhrman J, Ferreri DM. Fueling the vegetarian (vegan) athlete. Curr +Sports Med Rep. 2010 Jul-Aug;9(4):233-41. doi: +10.1249/JSR.0b013e3181e93a6f. Review. Erratum in: Curr Sports Med Rep. +2010 Sep-Oct;9(5):313. https://doi.org/10.1249/JSR.0b013e3181e93a6f

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. McAnulty LS, Nieman DC, Dumke CL, Shooter LA, Henson DA, Utter AC, +Milne G,McAnulty SR. Effect of blueberry ingestion on natural killer +cell counts,oxidative stress, and inflammation prior to and after 2.5 +h of running. Appl Physiol Nutr Metab. 2011 Dec;36(6):976-84.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7. Thomas DT, Erdman KA, Burke LM. Position of the Academy of Nutrition +and Dietetics, Dietitians of Canada, and the American College of +Sports Medicine: Nutrition and Athletic Performance. J Acad Nutr Diet. +2016 Mar;116(3):501-28.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9. Helms ER, Aragon AA, Fitschen PJ. Evidence-based recommendations for +natural bodybuilding contest preparation: nutrition and +supplementation. J Int Soc Sports Nutr. 2014 May 12;11:20. doi: +10.1186/1550-2783-11-20. eCollection 2014. Review. PubMed PMID: +24864135; PubMed Central PMCID: PMC4033492. https://doi.org/10.1186/1550-2783-11-20

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                11. Van Vliet S, Burd NA, van Loon LJ. The Skeletal Muscle Anabolic +Response to Plant- versus Animal-Based Protein Consumption. J Nutr. +2015 Sep;145(9):1981-91. doi: 10.3945/jn.114.204305. Epub 2015 Jul 29. +Review. PubMed PMID: 26224750. https://doi.org/10.3945/jn.114.204305

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                13. Eisinger M, Plath M, Jung K, Leitzmann C. Nutrient intake of endurance +runners with ovo-lacto-vegetarian diet and regular western diet. Z +Ernahrungswiss. 1994 Sep;33(3):217-29.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                What about children?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Start with this “Nutrition for Kids” guide, plus ideas for school lunches and Halloween treats, created by the +Physicians Committee for Responsible Medicine:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Nutrition For Kids" guide by Physicians Committee for Responsible Medicine +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To explain the remaining factors to children, try this kid-friendly series:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                What about the elderly?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +The Okinawa Diet: Living to 100 — +What would happen if you centered your diet around vegetables, the most nutrient-dense food group?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                CGTN highlights Dr. Ellsworth Wareham who has +been Vegan for 50 years, retired from being a heart surgeon at age 95 +by choice, and is now a centenarian. He still walks without a cane, +climbs stairs, mows his own lawn, and drives a car:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                He also happens to live in the Loma Linda “blue zone”, which has a +significant population of long-lived people that eat plant-based diets, +exercise regularly, maintain a healthy weight, don’t smoke, and drink +neither alcohol nor caffeine.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. CGTN America. Dr. Ellsworth Wareham: The secret to living longer. +Television news recording from China Global Television Network in +Washington, D.C. which aired on October 2, 2015. Retrieved January 30, +2017 from https://youtu.be/xJCRm5dmZIA

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Fraser GE, Shavlik DJ. Ten Years of Life: Is It a Matter of Choice?. +Arch Intern Med. 2001;161(13):1645-1652. +doi:10.1001/archinte.161.13.1645 +https://doi.org/10.1001/archinte.161.13.1645

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To detox pollutants

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Another reason to avoid consuming animal products is the prevalence of +environmental toxins and pollutants in their food supply which, through +biomagnification up the food chain, human consumers +intake at dangerous levels:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +ALS (Lou Gehrig’s Disease): Fishing for Answers — +The neurotoxin BMAA is found in seafood and the brains of Alzheimer’s and ALS victims. Might dietary changes help prevent amyotrophic lateral sclerosis?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                This effect was observed in pregnant American women by the Center for Disease +Control’s 2003-2004 study +and also in a sample of 364 children in California (why +California? because of its Proposition 65 law, which enforces the strictest +regulations in America on chemicals known to cause cancer and/or birth defects) +in whom heavy metals, banned pesticides, and other toxic pollutants were found:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +California Children Are Contaminated — +The levels of arsenic, banned pesticides, and dioxins exceeded cancer benchmarks in each of the 364 children tested. Which foods were the primary sources of toxic pollutants for preschoolers and their parents?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +CDC Report on Environmental Chemical Exposure — +The latest national survey on the levels of chemical pollutants (such as heavy metals, toxic solvents, endocrine-disrupters, flame-retardant chemicals, PCBs), and pesticides (such as DDT) in the bodies of pregnant and non-pregnant Americans.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Protein, Puberty, & Pollutants — +The early onset of puberty in girls associated with animal protein consumption may be due to endocrine-disrupting chemical pollutants in the meat supply.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Male Fertility & Diet — +Dioxins, endocrine disrupting pollutants, heavy metals, saturated fat, and steroids in the meat supply may be affecting sperm counts, semen quality, and the ability of men to conceive.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Sustainable living

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “Replacing meat with plants… is the best thing you can do to help” our planet, +according to WildAid’s infographic, from +their “Less Meat, Less Heat” campaign:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Per Kg of food:BeefPorkChickenPlants
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Total GHGs56.6 KgCO2e8.8 KgCO2e7 KgCO2e5 KgCO2e
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Crops use13 Kg5.9 Kg3.5 Kg0 Kg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Water use15,000 L6,000 L4,300 L660 L
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Land use30 m220 m218 m21 m2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +Cowspiracy infographic for Earth Day +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"So that's 5.25 billion burgers, fries, & milkshakes and 1.75 billion kids' meals with plastic toys. Say-- how you gonna pay for all this?" by Bizarro +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To fight pollution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The Cowspiracy documentary’s infographics explore +these facts in more detail:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Eating meat is killing the Gulf" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The fecal waste of 60 billion farm animals has to go somewhere." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Raw animal waste 'lagoons' pollute floodwaters." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To secure our future

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dr. Richard Oppenlander illuminates the +relationship between your food choices and our future in this official +lecture at the Hawaii State Capitol Auditorium endorsed by the Senate of Hawaii +(which can be seen earlier, at time mark 3:33):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                He also summarized these findings to the EU Parliament in 2015, along with the +producers of the Cowspiracy documentary, which was subsequently screened there:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Among those producers is Dr. Sailesh Rao, who gave this lecture at my workplace:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                According to this news article in The Huffington Post, with sources cited below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • 45% of the earth’s land is used by animal agriculture.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • 30% of the earth’s fresh water is used by animal agriculture.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Livestock excrete 335 megatons of “dry matter” waste every year.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • 2.7 trillion animals are pulled out from the oceans every year.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • 91% of Amazon rainforest destruction is by animal agriculture.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • 60% of the earth’s primate species are threatened to extinction.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • We’re causing the sixth mass extinction on planet Earth, right now.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Truth, Justice, and Wisdom vs 99-cent burgers" by Bizarro +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Hannah Sentenac. With Trump As President, It’s More Important Than +Ever To Go Vegan. The Huffington Post, 23 January 2017. +https://www.huffingtonpost.com/entry/58839aa1e4b0111ea60b9696

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Ceballos G, Ehrlich PR, Barnosky AD, García A, Pringle RM, Palmer TM. +Accelerated modern human–induced species losses: Entering the sixth +mass extinction. Science advances. 2015 Jun 1;1(5):e1400253. +https://advances.sciencemag.org/content/1/5/e1400253.full

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. Robert Goodland and Jeff Anhang. Livestock and Climate Change: What if +the key actors in climate change are…cows, pigs, and chickens? +World Watch Magazine, Volume 22, Issue 6, November/December 2009. +http://www.worldwatch.org/node/6294 abstract; full text available at +http://www.worldwatch.org/files/pdf/Livestock%20and%20Climate%20Change.pdf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7. Thornton, P., Herrero, M. and Ericksen, P. 2011. Livestock and climate +change. Livestock Exchange Issue Brief 3. Nairobi, Kenya: ILRI. +http://hdl.handle.net/10568/10601 abstract; full text available at +https://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9. Sergio Margulis. 2003. Causes of deforestation of the Brazilian +Amazon. Washington, DC: World Bank. +http://documents.worldbank.org/curated/en/758171468768828889

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                11. A Mood and P Brooke. Estimating the Number of Fish Caught in Global +Fishing Each Year. July 2010. Retrieved 23 January 2017, from +http://www.fishcount.org.uk/published/std/fishcountstudy.pdf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                13. GRACE Communications Foundation. Sustainable Table of Waste +Management. Retrieved 23 January 2017, from +http://www.sustainabletable.org/906/waste-management

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Compassionate living

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Matthieu Ricard, famed biologist and Buddhist monk known as “the Happiest Man in the World”, contemplates the paradox of how we treat our fellow sentient beings:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Gary Yourofsky gave “The Most Important Speech You +Will Ever Hear” at Georgia Tech in 2010, which spread worldwide, was +translated into 30+ languages, and is credited for increasing Israel’s +Vegan population by 8%, +growing from 5% to 13%:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                In similar spirit, activist Earthling Ed educates university students in the UK:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Have you ever considered the health, environmental, & ethical benefits of veganism?" by Bizarro +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To bear witness

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Try the 360° VR iAnimal Experience in your browser, smartphone, or VR headset:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ExperienceUSA narrationUK narration
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Pig industryby musician Tony Kanalby actor Peter Egan
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dairy industryby actress Evanna Lynchby actress Evanna Lynch
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Chicken industryby artist Kat Von Dby actress Amanda Abbington
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Watch the Earthlings documentary about speciesism to witness even more of this.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                WARNING: This video is extremely disturbing!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                WARNING: This video is extremely disturbing!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                WARNING: This video is extremely disturbing!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                WARNING: This video is extremely disturbing!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                WARNING: This video is extremely disturbing!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The Birth of the Ag-Gag Laws" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Where meat comes from

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Land of Hope and Glory, 2017 documentary deemed as UK’s Earthlings.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Honest Ads illustrates the reality of meat advertising.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +“MEAT: Now With Added Gross Things!” infographic with sources cited.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"A prescription for disaster: 80% of antibiotics in the US are fed to farm animals." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"What do they feed the animals that people eat?" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The ride in between life and death." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Tools of the Trade: This is how meat gets to your plate." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Instruments of Death: The final step of an animal's sad journey to becoming food." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"When the label says that a product contains Gelatin..." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Where milk comes from

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +DAIRY IS SCARY! The dairy industry explained in 5 minutes.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Honest Ads illustrates the reality of dairy advertising.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Click to watch video +Is milk in India a special case? See full explanation here.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"How to get milk in four easy steps" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"A year in the life of a dairy cow" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Veal calves live short, tortured lives because people like to eat CHEESE." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The Life of A Cow (Infographic)" by PETA.org +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Where eggs come from

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Animal Equality investigates the modern industry of chicken and egg farming:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +Animal Legal Defense Fund sues Trader Joe's for deceptive egg carton labeling +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Caged versus Free Range eggs" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The Daily Grind" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The life of a chicken" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Where fish comes from

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +SEASPIRACY: What You Should Know About Fish, The Ocean, and More!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"How fish are caught: imagination vs reality." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Go Vegan! explores overfishing, fish oil, and mercury; with sources +cited below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Broken Oceans: Marine populations have been depleted by nearly half since 1970." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Worm B, Barbier EB, Beaumont N, et al. Impacts of biodiversity loss on +ocean ecosystem services. Science. Nov 3 2006;314(5800):787-790.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Fumagalli M, Moltke I, Grarup N, Racimo F, Bjerregaard P, Jørgensen ME, +Korneliussen TS, Gerbault P, Skotte L, Linneberg A, Christensen C, +Brandslund I, Jørgensen T, Huerta-Sánchez E, Schmidt EB, Pedersen O, +Hansen T, Albrechtsen A, Nielsen R. Greenlandic Inuit show genetic +signatures of diet and climate adaptation. Science. 2015 Sep +18;349(6254):1343-7.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. Enns JE, Yeganeh A, Zarychanski R, Abou-Setta AM, Friesen C, Zahradka +P, Taylor CG. The impact of omega-3 polyunsaturated fatty acid +supplementation on the incidence of cardiovascular events and +complications in peripheral arterial disease: a systematic review and +meta-analysis. BMC Cardiovasc Disord. 2014 May31;14:70.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7. Rizos EC, Ntzani EE, Bika E, Kostapanos MS, Elisaf MS. Association +between omega-3 fatty acid supplementation and risk of major +cardiovascular disease events: a systematic review and meta-analysis. +JAMA. 2012 Sep 12;308(10):1024-33.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9. Makrides M, Gibson RA, McPhee AJ, Yelland L, Quinlivan J, Ryan P; +DOMInO Investigative Team. Effect of DHA supplementation during +pregnancy on maternal depression and neurodevelopment of young +children: a randomized controlled trial. JAMA. 2010 Oct +20;304(15):1675-83.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                10. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                11. Chow O, Barbul A. Immunonutrition: Role in Wound Healing and Tissue +Regeneration. Adv Wound Care (New Rochelle). 2014 Jan 1;3(1):46-53. +Review.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                12. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                13. Kaushik M, Mozaffarian D, Spiegelman D, Manson JE, Willett WC, Hu FB. +Long-chain omega-3 fatty acids, fish intake, and the risk of type 2 +diabetes mellitus. Am J Clin Nutr. 2009 Sep;90(3):613-20. Epub 2009 +Jul 22.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                14. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                15. Lee C, Liese A, Wagenknecht L, Lorenzo C, Haffner S, Hanley A. Fish +consumption, insulin sensitivity and beta-cell function in the Insulin +Resistance Atherosclerosis Study (IRAS). Nutr Metab Cardiovasc Dis. +2013 Sep;23(9):829-35.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                16. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                17. WHO Fact Sheets / ToxFAQs: CABSTM / Chemical Agent Briefing Sheet / +ToxFAQs for Polychlorinated Biphenyls (PCBs).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                18. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                19. Harada M. 1995. Minamata disease: methylmercury poisoning in Japan +caused by environmental pollution. Crit Rev Toxicol 25(1):1–24.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                20. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To understand why

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dr. Melanie Joy explains the psychology behind +“The Secret Reason We Eat Meat”:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"We don't serve your kind here." by Bizarro +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Logic and fallacy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Isaac, the genius behind “Ask Yourself”, holds up logic as a mirror for ethics:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Suddenly, against all predictions, veganism became a world-wide credo" by Bizarro

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Your Vegan Fallacy Is… dispels misconceptions using logic and rationale:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"A vegan activist's great-great-great grandmother..." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"...and people complain that vegans anthropomorphize animals" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                How do I get started?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Start with “The Daily Dozen” nutrition checklist created by Dr. Michael Greger:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Dr. Greger’s Daily Dozen Checklist

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Dr. Greger's Daily Dozen" infographic with Imperial units +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Dr. Michael Greger's Daily Dozen" infographic by Modern Vegan Family +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Take a challenge!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + +"Any other ideas for turning people vegan?" by Bizarro +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Kickstart your health

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The Physicians Committee for Responsible Medicine has created a free 21-day +Vegan kickstart program which was broadcast on PBS (national public television):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Comprehensive meal plan for all 21 days, organized by week +one, +two, +three.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. 1-minute webcasts to guide you +on shopping, cooking, nutrition, and health:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Click to watch video +(This is a playlist containing 9 webcasts, each a minute long.)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                India 21-day kickstart

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The Physicians Committee for Responsible Medicine has created a free 21-day +Vegan kickstart program for India and those of Indian origin at +21DayKickstartIndia.org and +BuildingAHealthyIndia.org containing a +comprehensive 21-day meal plan with recipes, cooking demonstrations, nutrition +tips, and more!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                SHARAN offers an assisted 21-day health retreat using this program:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                For your convenience, here is a list of main takeaways from the program:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Recipes Booklet with Nutrition Tips (8 color pages) +featuring Mango Shake, Soy Kheema, Curd Rice, Sheera, Bhel, Palak Moong Dal.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Fact Sheet for preventing and reversing Diabetes and Heart Disease, high blood pressure, obesity, etc. This is also available in Hindi.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                5. Ingredient Substitution Chart for meat, eggs, dairy, and oils. This is also available in Hindi.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                7. Indian and Western style recipes organized into categories by Breakfast, Snacks, Main Course, Dessert and classic teas +like Masala Chai with Soymilk. +Also check out these oil-free cooking demonstrations of popular Indian recipes +such as Cucumber Salad, Navaratan Kurma, and Sheera +Dessert.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Dr. Nandita Shah of SHARAN demonstrates healthy cooking techniques. (This is a playlist containing more than two dozen videos!)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Dr. Nandita Shah of SHARAN demonstrates Masala Chai with Soymilk.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video +Dr. Nandita Shah of SHARAN demonstrates popular Indian recipes: Cucumber Salad, Navaratan Kurma, and Sheera Dessert.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. The 21-day Indian Meal Plan (a comprehensive daily schedule for 3 weeks) +takes the hard work out of planning what and when to eat: each day is packed +with a unique variety of breakfast, lunch, snack, and dinner options.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                3. Get Inspired by nutrition experts and your favorite Bollywood Stars.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Food alternatives

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"You may already be eating Vegan food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Eating vegan is not complicated." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Plant-Powered School Lunches" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The world's least expensive foods are plants" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Get back to your Roots" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Know beans" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Aquafaba: bean water" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"There are many excellent sources of Vegan protein" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Discover the satisfiyng Vegan sources of Umami" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Open your eyes to Vitamin A" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"There are many great Vegan sources of iron" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"2016 is the international year of pulses" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                International flavors

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The united flavors of Vegan food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Moroccan food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Irish food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Southwestern food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Mexican food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Spanish food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of French food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Italian food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Greek food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Lebanese food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Ethiopian food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan flavors of Thai food" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Meat alternatives

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Meatless proteins are on the rise." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Meet the new Meat" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Bacon shouldn't have to come from a pig" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The best burgers are kind to animals" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Thanksgiving doesn't require the death of a turkey" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Happy Vegan Hanukkah!" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Liberate your Seder plate by celebrating a cruelty-free Passover" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Milk alternatives

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Milk. It doesn't have to come from a cow." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"No cows were harmed in the making of this Cheese" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"I scream, you scream, we all scream for Vegan ice cream" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"You don't need dairy to get Calcium." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Egg alternatives

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Eggs without the cruelty" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Baking? There is no need for eggs" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Fish alternatives

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Go Fish. (without hurting any sea animals)" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Sweets alternatives

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan holiday cookie magic!" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Vegan (& fair trade) Candy" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"I scream, you scream, we all scream for Vegan ice cream" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Other alternatives

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"No, our shoes aren't made of leather!" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Fur is dead! in San Francisco, at least." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dawning a new era

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Plant Based News reports show that people are changing as awareness spreads:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                See also how Israel has embraced Veganism in this 2013 Israeli TV news report:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                See also how Indian families are making the connection and becoming the change:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Veganic (stock-free farming) is the future of agriculture" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Finally, hospitals are to provide plant-based meals and remove processed meats from menus." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"School lunches go plant-based in Brazil." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Sales of dairy alternatives are really taking off!" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Irish people are eliminating dairy" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"More college students are demanding Vegan food." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The number of Vegans in Great Britain has grown by more than 350% in the last decade." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"The future is turning away from meat." by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"What do all these billionaires have in common?" by VeganStreet.com +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Want to learn more?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Health:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Logic:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Reality:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Earthlings documentary exposes speciesism, by which we abuse animals.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Cowspiracy documentary exposes +animal agriculture and climate change.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • What the Health exposes +healthcare corruption and animal agriculture.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Forks over knives documentary +explores how animal products harm health.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Before the flood documentary on +climate change, by National Geographic.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Transition:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Challenge 22 helps you transition in just 22 +days, with free mentoring.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • The Veganuary challenge and community helps +people become and stay Vegan.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • The HappyCow community lists and ranks +Vegan restaurants around the world.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Thank you!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"Introspection" cartoon by VeganSidekick.com

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/vim-256color-bce.html b/vim-256color-bce.html new file mode 100644 index 0000000..a089b61 --- /dev/null +++ b/vim-256color-bce.html @@ -0,0 +1,178 @@ +Fixing Vim's Background Color Erase for 256-color tmux and GNU screen - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Fixing Vim's Background Color Erase for 256-color tmux and GNU screen

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Summary
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Approach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Summary

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Run :set t_ut= to disable Background Color Erase.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3. Run :redraw or press <C-L> to repaint the background.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        5. Use terminalkeys +and fixkey +to recognize modifier keys.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        This is what you would see if you applied the Zenburn color scheme to +Vim running under the TERM=xterm-256color environment inside tmux or +GNU screen, which itself was attached to the xterm-256color terminal:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Flaky background in TERM=xterm-256color +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Here, the terminal’s background color bleeds into Vim’s and, depending +on the contrast between those two colors, makes Vim use highly unpleasant.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Thankfully, you can fix this by running :set term=screen-256color inside +Vim or by relaunching Vim under the TERM=screen-256color environment, +as some experts recommend:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Solid background in TERM=screen-256color +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        However, if you rely on Vim’s ability to sense modifier keys—such as +Shift, Control, and Alt—because you use them to define custom keyboard +shortcuts like I do, then you would soon discover that Vim does +not recognize some of them inside the screen-256color terminal.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Thus you would be faced with a most unnerving dilemma:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Do you forfeit your custom keyboard shortcuts to gain a proper +background color by running Vim inside the screen-256color terminal?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3. Do you suffer background color bleeding to retain your custom keyboard +shortcuts by running Vim inside the xterm-256color terminal?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Alas, is it truly a binary choice? Must you really forgo your personal +keyboard shortcuts in order to view your chosen Vim color scheme properly? +No, I would not accept such a fate; there has to be a better way! >:O

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Approach

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        I knew about Vim’s ability to manipulate its host terminal through its +t_Co setting, which lets you override how many colors Vim thinks its +host terminal is capable of rendering. Thus, looking up :help t_Co in +Vim revealed numerous terminal settings—which all happened to be listed +in the terminal-options section of Vim’s help documentation—that could +be overridden, hopefully in the same way, to perhaps solve this problem.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        However, there were too many settings in the documentation to practically +investigate by hand, so I narrowed down the possibilities to the following +eleven settings by searching for the words “color” and then “clear”:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        OUTPUT CODES
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  option  meaning
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_AB    set background color (ANSI)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_AF    set foreground color (ANSI)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_cd    clear to end of screen
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_ce    clear to end of line
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_cl    clear screen
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_Co    number of colors
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_me    Normal mode (undoes t_mr, t_mb, t_md and color)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_op    reset to original color pair
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_Sb    set background color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_Sf    set foreground color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  t_ut    clearing uses the current background color
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        I then observed the values of these settings in both environments so that +I could (1) compare them to discover what makes Vim render its background +color correctly in the screen-256color terminal and then (2) replicate +those values to achieve the same effect in the xterm-256color terminal.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        screen-256color observations:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        t_cd=^[[J
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_ce=^[[K
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_cl=^[[H^[[J
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_Co=256
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_me=^[[0m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_op=^[[39;49m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_Sb=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_Sf=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_ut=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        xterm-256color observations:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        t_cd=^[[J
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_ce=^[[K
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_cl=^[[H^[[2J
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_Co=256
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_me=^[[m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_op=^[[39;49m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_Sb=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_Sf=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +t_ut=y
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Differences in observations:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        --- screen-256color observations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++++ xterm-256color observations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +@@ -1,11 +1,11 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + t_cd=^[[J
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + t_ce=^[[K
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-t_cl=^[[H^[[J
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++t_cl=^[[H^[[2J
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + t_Co=256
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-t_me=^[[0m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++t_me=^[[m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + t_op=^[[39;49m
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + t_Sb=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + t_Sf=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +-t_ut=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ++t_ut=y
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Comparing these observations, I found that xterm-256color only differed +from screen-256color in these three settings: t_cl, t_me, and t_ut.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        One by one, I applied the screen-256color value of each differing setting +to a Vim session that was running inside my desired xterm-256color +terminal and then pressed Control-L to make Vim redraw itself. Changing +t_cl and t_me had no effect but, luckily, t_ut did the trick! :-)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        This makes sense because, according to Vim documentation, not only does +t_ut control whether Vim “uses the current background color” to clear +the screen (also known as Background Color Erase, or BCE for +short) but it also takes effect only when its value is a non-empty string.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        In this case, Vim used BCE in xterm-256color because, under that terminal, +t_ut had value y: a non-empty string. Conversely, Vim did not use +BCE in screen-256color because under that terminal, t_ut had no value.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Therefore, the solution is to simply clear Vim’s t_ut value if Vim +happens to be running inside any 256-color terminal. You can automate +this by adding the following snippet to your Vim configuration file:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        if &term =~ '256color'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  " disable Background Color Erase (BCE) so that color schemes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  " render properly when inside 256-color tmux and GNU screen.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  " see also http://snk.tuxfamily.org/log/vim-256color-bce.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +  set t_ut=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +endif
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        \ No newline at end of file diff --git a/vim-script-management-system.html b/vim-script-management-system.html new file mode 100644 index 0000000..cf435dc --- /dev/null +++ b/vim-script-management-system.html @@ -0,0 +1,46 @@ +Vim script management system - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Vim script management system

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Inspired by pathogen and GLVS, I put together a very simple +system for managing Vim scripts (known as bundles +henceforth) downloaded from http://www.vim.org/scripts/.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Bundles are kept in their own self-contained subdirectories inside the +~/.vim/bundle/ directory and they are added dynamically to Vim’s +runtimepath by the following activation code (which has since evolved into +the unbundle.vim plugin) in the ~/.vimrc file:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        " register bundles found in the runtimepath
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +let s:bundles = tr(globpath(&runtimepath, 'bundle/*/.'), "\n", ',')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +let s:afters = tr(globpath(s:bundles, 'after/.'), "\n", ',')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +let &runtimepath = join([s:bundles, &runtimepath, s:afters], ',')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +" activate ftplugin/ scripts inside bundles
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +filetype off
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +filetype plugin indent on
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Bundles are installed and upgraded by the get.rb script (which has since +evolved into the update script) which looks for ~/.vim/bundle/*.get +files that specify their respective bundles’ script_id numbers taken +from their download URLs:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        http://vim.org/scripts/script.php?script_id=NUMBER
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Thus I am able to easily install, upgrade, and remove bundles. See my +personal Vim configuration for further details.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        \ No newline at end of file diff --git a/wmii-3.1-ruby-config.html b/wmii-3.1-ruby-config.html new file mode 100644 index 0000000..bbc34bc --- /dev/null +++ b/wmii-3.1-ruby-config.html @@ -0,0 +1,271 @@ +wmii-3.1 configuration in Ruby - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        wmii-3.1 configuration in Ruby

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Quick & light Ruby interface
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Interactive Ruby shell
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Logging and recovery
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Related works
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Screen shots
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. A colorful mess
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Automated arrangements
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Multiple client selection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      2. Requirements
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Ruby
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. wmii
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Patches
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. Interactive live demonstration
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Operations on multiple clients
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Easy column manipulation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1. Automated client arrangement
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Temporary working area
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  2. Installation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    This article presents my patches to the wmii window manager and my Ruby-based configuration thereof. You can download wmii-3.1 with my patches pre-applied or clone it yourself +from my GitHub repository:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    git clone git://github.com/sunaku/wmii.git
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Quick & light Ruby interface

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The ruby-ixp library is used to communicate +directly with wmii’s IXP file +system +instead of the wmiir tool. Thus, wmii’s responsiveness is dramatically +improved.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    A light abstraction layer +is built atop the ruby-ixp library to encapsulate access to wmii. This layer +includes the ability to dynamically traverse the IXP file system by simply +calling methods (thanks to Ruby’s method_missing facility). For instance, +you can write “foo” into the file /view/sel/sel/tags via any of the +following:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Wmii.current_client.tags = 'foo'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +Wmii.fs.view.sel.sel.tags = 'foo'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +Ixp::Client.write '/view/sel/sel/tags', 'foo'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Interactive Ruby shell

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The wmiish tool can be used to interact with wmii without having to +install my wmiirc. It presents the previously discussed light abstraction +layer within a standard IRB session. In fact, it even accepts the standard IRB +command-line options!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Logging and recovery

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Unhandled exceptions are logged to ~/.wmii-3/wmiirc.log and then reported to +the user, who can then choose to recover from or fix the error. Thus, you +won’t be left helpless if your configuration breaks.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Related works

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ruby-wmii is Mauricio Fernandez’s +popular Ruby-based configuration for wmii. It is very sophisticated and +extensible, through a nice plugin interface.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Screen shots

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    As they say, “a picture is worth a thousand words”. So whet your appetite with +these screen shots before diving into the discussion below. But don’t forget +that you’ll be trying these out yourself shortly, in the interactive live +demonstration!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    A colorful mess

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    I first made a mess, colored generously for aesthetics, in my view by +executing for c in red green blue black orange brown gray navy gold; do xterm +-bg $c -title $c -e read & done in my shell. Then, I started up wmiish to +demonstrate some of the stuff discussed below.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +An empty desktop.The first inhabitant.A colorful desktop. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Automated arrangements

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The tile arrangement, caused by the current_view.tile! command:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +current_view.tile!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The grid arrangement, caused by the current_view.grid! command:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +current_view.grid!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The diamond arrangement, caused by the current_view.diamond! command:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +current_view.diamond! +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Multiple client selection

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Here I reorganized the view to give enough space for the terminal by typing +the following code.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    # apply tiling arrangement
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +current_view.tile!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +# set second column to stacking mode
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +current_view[2].mode = :stack
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Back to the drawing board.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Next I selected the three primary colored clients (NOTE: I normally do this by +right-clicking on their title bars or through other shortcuts, because that’s +how my wmiirc‘s event loop is configured) by typing the following code. +Notice that those clients also appear in the “SEL” view.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    # the primary colors
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +colors = %w[ red green blue ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +# select clients named after the primary colors
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +clients.each do |c|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  if colors.include? c.name
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +    c.select!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    A selection of primary colors.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Finally I put each client in the selection into its own view by typing the +following code.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    # tag each selected client with its own name
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +selected_clients.each do |c|
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +  c.tag! c.name
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +end
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Tagging the selection. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Requirements

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Ruby

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    You need at least version 1.8 of Ruby installed.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    wmii

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Apply this giant patch, which +includes all of my patches, before compiling and installing +wmii-3.1. Note that if you’re only interested in trying wmiish, then +only the “unique client ID numbers in file system” patch is necessary.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    $ ls
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +wmii-3.1.patch wmii-3.1.tar.gz
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +$ tar zxf wmii-3.1.tar.gz
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +$ patch -p0 < wmii-3.1.patch
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +patching file wmii-3.1/cmd/wm/area.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +patching file wmii-3.1/cmd/wm/client.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +patching file wmii-3.1/cmd/wm/fs.c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +patching file wmii-3.1/cmd/wm/wm.h
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +$ cd wmii-3.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +$ make install
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Patches

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Column focus wraps horizontally in a view. When the right-most column is currently focused, selecting the nonexistent column at the right will put focus on the left-most column, and vice versa.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Unique client ID numbers are presented in the IXP file system to avoid many race conditions and simpify the task of scripting. For example, without this patch, when the number of clients in an area changes, the area’s indices, through which those clients are accessed, change. Thus, you lose track of your client(s) of interest every time there is a change to the current area. :-(

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Prevents a segfault from occuring when a client is sent to the column it is already in.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Enables sending of clients from the floating area to any other area, via the sendto area_number command.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Enables swapping of a client with the currently focused client in any column, via the swap column_number command.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Enables creation and focusing of an empty view, as long as it is currently focused, via the view name_of_view command.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Fixes a bug that causes wmii-3.1 to freeze when the /event file is read too quickly by too many readers.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Interactive live demonstration

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Once you’ve satisfied the requirements, you can try this demonstration (in +real-time!) using wmiish. Also, have a look at the provided documentation +for available commands and my wmiirc configuration for more examples to +try.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Operations on multiple clients

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    You can select multiple clients and perform operations on them. This is useful +when you want to do something with a group of clients but don’t want to +manually focus one, perform the action, focus the next one, and so on.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Another important aspect is that selected clients stay selected until they are +unselected. This allows you to continue performing tasks on the selection +without having to reselect the same clients after every operation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    For example, try executing the following commands in wmiish.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Make all clients, except those in the current column, also appear inside the “foo” view:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view.select! current_area.unselect! selected_clients.each {|c| c.tag! 'foo'}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Make all unselected clients in the current view also appear in the “qux” view:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view.invert_selection! selected_clients.each {|c| c.tag! 'qux'}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +current_view.invert_selection!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Easy column manipulation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    You can insert a group of clients to the top, bottom, or after the currently +focused client of any column using these simple +methods.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    For example, try executing the following commands in wmiish.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Send all clients in the current column to the floating area:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view[0].concat! current_area
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Move the second two clients from the first column to the top of the third column:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view[3].unshift! current_view[1].clients[1..2]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Automated client arrangement

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    You can arrange all clients in the current view using these automated +arrangements. They +help you maintain clean, uncluttered, usable views.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    For example, try executing the following commands in wmiish.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Apply LarsWM style tiling arrangement:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view.tile!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Apply wmii-2 style grid arrangement:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view.grid!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Apply a diamond-shaped arrangement:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view.diamond!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Put each client in its own column:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view.grid! 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Put three clients per each column:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view.grid! 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Squeeze all clients into a single column:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    current_view.grid! 0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Temporary working area

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    You can send selected clients to a temporary working area (see the rationale +and use case for +this idea) and bring them back again when you’re finished. Try this by +executing toggle_temp_view in wmiish.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Installation

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Download and extract the contents of the package into your ~/.wmii-3 directory.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    3. Edit the ~/.wmii-3/wmiirc-config.rb file to accomodate your needs.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    5. Reboot wmii.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Readably written, Everforest colored.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Like my work? 👍 Please spare a life today as +thanks! 🐮🐷🐔🐟🙊✌💞

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    \ No newline at end of file diff --git a/xfce-enlarge-titlebar-buttons.html b/xfce-enlarge-titlebar-buttons.html new file mode 100644 index 0000000..f128c5d --- /dev/null +++ b/xfce-enlarge-titlebar-buttons.html @@ -0,0 +1,38 @@ +Enlarging titlebar buttons in XFCE - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Enlarging titlebar buttons in XFCE

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      1. Approach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Although the XFCE desktop environment offers an +easy way to enlarge its user interface via Settings -> Appearance -> Fonts -> +Custom DPI setting, such changes do not apply to titlebar buttons (such as +the minimize, maximize, and close buttons) whose size remains constant.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Approach

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The only workaround is to modify the +XFCE theme by enlarging the underlying images that form titlebar buttons. +Thankfully, I found a way to automate this laborious process as follows.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Install ImageMagick:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            sudo apt-get install imagemagick
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3. Start with a copy of an existing theme (“Numix” in this example):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            mkdir ~/.themes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +cp -rT /usr/share/themes/Numix ~/.themes/Numix-large
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          5. Enlarge images for titlebar buttons (to 48 pixels in this example):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            cd ~/.themes/Numix-large/xfwm4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +for image in {top,title,menu,stick,shade,hide,maximize,close}-*.*
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +do mogrify -resize x48 "$image"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +done
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          6. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          7. Apply your newly created large theme by choosing it from the list:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            xfwm4-settings
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          8. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          That’s all, enjoy!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/xoria256-menu-color-patch.html b/xoria256-menu-color-patch.html new file mode 100644 index 0000000..8391e1b --- /dev/null +++ b/xoria256-menu-color-patch.html @@ -0,0 +1,24 @@ +xoria256 menu color patch - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          xoria256 menu color patch

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Vim’s menus are difficult to read under the +xoria256 color scheme:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          menu colors before patching +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          So I patched them (using colors from the same palette) as follows:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          colorscheme xoria256
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +highlight Pmenu    ctermbg=188 guibg=#d0d0d0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +highlight PmenuSel ctermfg=188 guifg=#d0d0d0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          This results in higher contrast menus that are easier to read:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          menu colors after patching +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I sent this patch to Dmitriy Y. Zotikov, the +author of xoria256, in +hopes that he will incorporate it into the official version of the color +scheme.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/xoria256-terminal-color-scheme.html b/xoria256-terminal-color-scheme.html new file mode 100644 index 0000000..d61f4cc --- /dev/null +++ b/xoria256-terminal-color-scheme.html @@ -0,0 +1,142 @@ +xoria256 terminal color scheme - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          xoria256 terminal color scheme

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I have grown fond of Vim’s xoria256 color +scheme recently. +It features “finely tuned soft gamma” using 256 colors on a dark +background, and claims to appear the same in both graphical and terminal +Vim; although I found the latter to be slightly muted (particularly 8 +units less in byte value in at most two color channels) according to +xmag and gcolor2.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I ported it to the terminal last night (see screenshots below) and was +pleased with the result: it felt balanced, colorful, and easy on my eyes.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          the color scheme +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          UNIX manual page +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          To use this color scheme in hterm, open the nassh extension’s settings page, +open Chrome Developer Tools, and then run the following snippet in the console:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          term_.prefs_.set("background-color", "#1c1c1c");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +term_.prefs_.set("foreground-color", "#d0d0d0");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +term_.prefs_.set("cursor-color", "rgba(255,175,0, 0.5)"); /* #ffaf00 */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +term_.prefs_.set("color-palette-overrides", ["#121212", "#d78787", "#afd787",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +"#f7f7af", "#87afd7", "#d7afd7", "#afd7d7", "#e6e6e6", "#0a0a0a", "#df8787",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +"#afdf87", "#ffffaf", "#87afdf", "#dfafdf", "#afdfdf", "#eeeeee"]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          To use this color scheme in Rxvt or XTerm, save the following snippet to a file +such as ~/.Xdefaults and then run xrdb -merge on that file to apply it. Any +terminals launched thereafter will use this color scheme, but not existing ones.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          !black.normal        : xoria256.LineNr.guibg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!black.bright        : black.normal.rgb - 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color0        #121212
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color8        #0a0a0a
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!red.normal          : red.bright.r - 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!red.bright          : xoria256.Special.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color1        #d78787
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color9        #df8787
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!green.normal        : green.bright.g - 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!green.bright        : xoria256.PreProc.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color2        #afd787
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color10       #afdf87
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!yellow.normal       : yellow.bright.rg - 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!yellow.bright       : xoria256.Special.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color3        #f7f7af
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color11       #ffffaf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!blue.normal         : blue.bright.b - 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!blue.bright         : xoria256.Statement.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color4        #87afd7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color12       #87afdf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!magenta.normal      : magenta.bright.rb - 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!magenta.bright      : xoria256.Identifier.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color5        #d7afd7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color13       #dfafdf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!cyan.normal         : cyan.bright.gb - 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!cyan.bright         : green.bright + blue.bright
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color6        #afd7d7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color14       #afdfdf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!white.normal        : white.bright.rgb - 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!white.bright        : xoria256.Folded.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color7        #e6e6e6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _color15       #eeeeee
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!bold                : xoria256.Type.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!underline           : xoria256.htmlValue.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _colorBD       #afafdf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _colorUL       #dfdfaf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!foreground          : xoria256.Normal.guifg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!background          : xoria256.Normal.guibg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +!cursorColor         : xoria256.Cursor.guibg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _foreground    #d0d0d0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _background    #1c1c1c
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +#define _cursorColor   #ffaf00
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color0         : _color0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color1         : _color1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color2         : _color2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color3         : _color3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color4         : _color4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color5         : _color5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color6         : _color6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color7         : _color7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color8         : _color8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color9         : _color9
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color10        : _color10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color11        : _color11
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color12        : _color12
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color13        : _color13
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color14        : _color14
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*color15        : _color15
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*colorBD        : _colorBD
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*colorIT        : _colorIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*colorUL        : _colorUL
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*foreground     : _foreground
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*background     : _background
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +URxvt*cursorColor    : _cursorColor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color0         : _color0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color1         : _color1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color2         : _color2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color3         : _color3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color4         : _color4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color5         : _color5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color6         : _color6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color7         : _color7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color8         : _color8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color9         : _color9
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color10        : _color10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color11        : _color11
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color12        : _color12
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color13        : _color13
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color14        : _color14
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*color15        : _color15
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*colorBD        : _colorBD
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*colorIT        : _colorIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*colorUL        : _colorUL
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*foreground     : _foreground
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*background     : _background
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*cursorColor    : _cursorColor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +! enable coloring for bold and underlined text
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*vt100.boldColors     : False
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*vt100.colorBDMode    : True
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*vt100.colorULMode    : True
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*vt100.colorRVMode    : False
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +XTerm*vt100.veryBoldColors : 6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Updates


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \ No newline at end of file diff --git a/yaml-json-validation-kwalify-ruby19.html b/yaml-json-validation-kwalify-ruby19.html new file mode 100644 index 0000000..cdd6fde --- /dev/null +++ b/yaml-json-validation-kwalify-ruby19.html @@ -0,0 +1,87 @@ +Validating machine-generated YAML and JSON using Kwalify in Ruby 1.9 - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Validating machine-generated YAML and JSON using Kwalify in Ruby 1.9

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1. Problem
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            1. Approach
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. Solution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Problem

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Kwalify is a Ruby library for +parsing and validating YAML and JSON +documents. However, it only supports a “mostly YAML 1.0” subset where the +bodies of mappings (values associated with hash keys) must be indented; +otherwise, the following error occurs:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ERROR: file:line:1 [/] document end expected (maybe invalid tab char found).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                For example, this is Kwalify style:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                language:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  - name: Ruby
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    type: dynamic
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +    license:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      - Ruby
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +      - GPL v2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                In contrast, this is YAML 1.0+ style:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                language:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +- name: Ruby
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  type: dynamic
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  license:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  - Ruby
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +  - GPL v2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                This poses a problem when validating machine-generated YAML documents in +Ruby 1.9 because its libyaml-based YAML library (known as “Psych”) only emits YAML 1.1 documents, +which are not the “mostly YAML 1.0” kind that Kwalify expects. For +example, the last line in the following code raises the aforementioned +error:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                require 'kwalify'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +schema = Kwalify::Yaml.load_file('some_complex_schema.yaml')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +validator = Kwalify::Validator.new(schema)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +parser = Kwalify::Yaml::Parser.new(validator)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +yaml = some_complex_object.to_yaml # machine-generate
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +data = parser.parse(yaml)          # parse & validate <== FAIL
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Approach

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                I initially approached this problem by trying to make Ruby’s YAML emitter +indent the bodies of mappings as the Kwalify style requires:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                require 'psych'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +yaml = Psych.dump(some_complex_object, indentation: 4).
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +       gsub(/^(\s*)-   (?=\S.*:)/, '\1  - ')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                However, this did not address the incompatibility between Ruby’s YAML 1.1 +emitter and Kwalify’s “mostly YAML 1.0” parser. For instance, Kwalify +choked on the notation of multi-line strings as expressed in YAML 1.1.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Defeated, I turned to the Kwalify user’s guide for a hint and found +one:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                JSON can be considered as a subset of YAML. It means that YAML +parser can parse JSON and Kwalify can validate JSON document.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Since Kwalify supports parsing and validating JSON documents, we can work +around the problem by machine-generating JSON documents instead of YAML +ones and then feed them into Kwalify for parsing and validation:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                require 'json'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +yaml = some_complex_object.to_json
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Unfortunately, Kwalify failed to parse the machine-generated JSON:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Kwalify::SyntaxError: file: , line 1: mapping key is expected.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                How could this be? The Kwalify user’s guide even has examples of JSON +parsing and validation. I promptly tried them out, via copy and paste, +and they worked exactly as advertised. Strange.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Upon further trails, I noticed the key difference between the examples +shown in the Kwalify user’s guide and our machine-generated JSON: the +lack of minification in the former. Armed with this knowledge, and +this helpful answer on StackOverflow, I finally arrived at a +workable solution:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                require 'json'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +yaml = JSON.pretty_generate(some_complex_object)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Solution

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Putting this all together, the final solution to the original problem is:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                require 'json'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +require 'kwalify'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +schema = Kwalify::Yaml.load_file('some_complex_schema.yaml')
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +validator = Kwalify::Validator.new(schema)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +parser = Kwalify::Yaml::Parser.new(validator)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +yaml = JSON.pretty_generate(some_complex_object) # machine-generate
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +data = parser.parse(yaml)                        # parse & validate
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Happy validating!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/zabutom-zeta-force-level-2.html b/zabutom-zeta-force-level-2.html new file mode 100644 index 0000000..4df537b --- /dev/null +++ b/zabutom-zeta-force-level-2.html @@ -0,0 +1,161 @@ +zabutom's Zeta Force Level 2, rearranged - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                zabutom's Zeta Force Level 2, rearranged

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The modestly titled “Zeta Force Level 2” chiptune by Swedish chip music artist +“zabutom” is undoubtedly my most favorite +short-length chiptune of all time:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Click to watch video

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The second melody, composed of patterns 0E-0F-10-11 at position 0F (~46 +seconds in), is pure genius: the electric guitar solo renders your epic +triumph over an enemy boss as your ship now accelerates into turbo, +tearing through hyperspace!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Whereas the first melody, composed of patterns 07-08-09-0A at position 07 +(~21 seconds in), sounds like an after-party that celebrates your recent +victory as you begin the next level on your galactic campaign, so it feels +out of place.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                This troubled me, for impatient listeners might judge the rest of the +track as being more of the same and stop early, missing out on the epic +second melody awaiting them. So I rearranged the track accordingly, using +MilkyTracker, and also spliced +together a shorter version for use as an epic ringtone on my phone:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                PositionOriginal versionRearranged versionRingtone version
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0103 (intro)03 (intro)02 (intro)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0202 (intro)02 (intro)00 (chorus 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0300 (chorus 1)00 (chorus 1)01 (chorus)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0401 (chorus)01 (chorus)04 (chorus)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0504 (chorus)04 (chorus)0D (chorus 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0605 (chorus 1)0D (chorus 2)0E (melody 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0706 (segue)0E (melody 2)0F (melody 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0807 (melody 1)0F (melody 2)10 (melody 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0908 (melody 1)10 (melody 2)11 (melody 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0A09 (melody 1)11 (melody 2)loop to position 01
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0B0A (melody 1)00 (chorus 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0C0B (chorus 2)01 (chorus)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0D01 (chorus)04 (chorus)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0E04 (chorus)05 (chorus 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0F0D (chorus 2)06 (segue)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                100E (melody 2)07 (melody 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                110F (melody 2)08 (melody 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1210 (melody 2)09 (melody 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1311 (melody 2)0A (melody 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1406 (segue)0B (chorus 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                15loop to position 03loop to position 04
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file diff --git a/zenburn-terminal-color-scheme.html b/zenburn-terminal-color-scheme.html new file mode 100644 index 0000000..b021ea8 --- /dev/null +++ b/zenburn-terminal-color-scheme.html @@ -0,0 +1,122 @@ +Zenburn terminal color scheme - The Terminal Programmer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Zenburn terminal color scheme

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Suraj N. Kurapati

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                You may have noticed that I’m rather fond of Vim’s Zenburn color +scheme. In fact, its colors +have graced this blog for more than a year now, ever since I began using +Readably as my blog engine.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                This time, I created a terminal color scheme using Zenburn’s “high +contast” palette. When choosing colors for this scheme, I started with +blue because there is only one blue (Number) in Zenburn, and then chose +the remaining colors based on how well they harmonized with that blue.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                the color scheme +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                UNIX manual page +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To use this color scheme in hterm, open the nassh extension’s settings page, +open Chrome Developer Tools, and then run the following snippet in the console:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                term_.prefs_.set("background-color", "#1f1f1f");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +term_.prefs_.set("foreground-color", "#dcdccc");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +term_.prefs_.set("cursor-color", "rgba(143,175,159, 0.5)"); /* #8faf9f */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +term_.prefs_.set("color-palette-overrides", ["#000d18", "#e89393", "#9ece9e",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"#f0dfaf", "#8cd0d3", "#c0bed1", "#dfaf8f", "#efefef", "#000d18", "#e89393",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +"#9ece9e", "#f0dfaf", "#8cd0d3", "#c0bed1", "#dfaf8f", "#efefef"]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To use this color scheme in Rxvt or XTerm, save the following snippet to a file +such as ~/.Xdefaults and then run xrdb -merge on that file to apply it. Any +terminals launched thereafter will use this color scheme, but not existing ones.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                !BLK Cursor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color0        #000d18
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color8        #000d18
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!RED Tag
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color1        #e89393
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color9        #e89393
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!GRN SpecialKey
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color2        #9ece9e
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color10       #9ece9e
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!YEL Keyword
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color3        #f0dfaf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color11       #f0dfaf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!BLU Number
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color4        #8cd0d3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color12       #8cd0d3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!MAG Precondit
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color5        #c0bed1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color13       #c0bed1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!CYN Float
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color6        #dfaf8f
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color14       #dfaf8f
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!WHT Search
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color7        #efefef
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _color15       #efefef
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!FMT Include, StatusLine, ErrorMsg
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _colorBD       #ffcfaf
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _colorUL       #ccdc90
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _colorIT       #80d4aa
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +!TXT Normal, Normal, Cursor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _foreground    #dcdccc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _background    #1f1f1f
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +#define _cursorColor   #8faf9f
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color0         : _color0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color1         : _color1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color2         : _color2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color3         : _color3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color4         : _color4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color5         : _color5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color6         : _color6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color7         : _color7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color8         : _color8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color9         : _color9
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color10        : _color10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color11        : _color11
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color12        : _color12
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color13        : _color13
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color14        : _color14
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*color15        : _color15
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*colorBD        : _colorBD
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*colorIT        : _colorIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*colorUL        : _colorUL
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*foreground     : _foreground
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*background     : _background
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +URxvt*cursorColor    : _cursorColor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color0         : _color0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color1         : _color1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color2         : _color2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color3         : _color3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color4         : _color4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color5         : _color5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color6         : _color6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color7         : _color7
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color8         : _color8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color9         : _color9
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color10        : _color10
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color11        : _color11
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color12        : _color12
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color13        : _color13
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color14        : _color14
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*color15        : _color15
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*colorBD        : _colorBD
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*colorIT        : _colorIT
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*colorUL        : _colorUL
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*foreground     : _foreground
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*background     : _background
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*cursorColor    : _cursorColor
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +! enable coloring for bold and underlined text
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*vt100.boldColors     : False
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*vt100.colorBDMode    : True
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*vt100.colorULMode    : True
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*vt100.colorRVMode    : False
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +XTerm*vt100.veryBoldColors : 6
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \ No newline at end of file