Printing with “\t” (tabs) does not result in aligned columns

Building on this question, I use the following code to indent my messages: String prefix1 = “short text:”; String prefix2 = “looooooooooooooong text:”; String msg = “indented”; /* * The second string begins after 40 characters. The dash means that the * first string is left-justified. */ String format = “%-40s%s%n”; System.out.printf(format, prefix1, msg); System.out.printf(format, … Read more

Vim keyboard shortcut to move around tabs

gt is the keyboard shortcut for :tabnext and gT for :tabprevious. If you prefer the typical Ctrl + Tab, define the following mappings in your ~/.vimrc: ” CTRL-Tab is next tab noremap <C-Tab> :<C-U>tabnext<CR> inoremap <C-Tab> <C-\><C-N>:tabnext<CR> cnoremap <C-Tab> <C-C>:tabnext<CR> ” CTRL-SHIFT-Tab is previous tab noremap <C-S-Tab> :<C-U>tabprevious<CR> inoremap <C-S-Tab> <C-\><C-N>:tabprevious<CR> cnoremap <C-S-Tab> <C-C>:tabprevious<CR>

Possible to detect if a user has multiple tabs of your site open?

I’m fairly late to the party here (over a year), but I couldn’t help but notice that you’d missed an incredibly easy and elegant solution (and probably what that website you saw used). Using JavaScript you can change the name of the window you currently have open through: window.name = “myWindow”; Then when you send … Read more

How to get current selected tab index in TabLayout?

Use OnTabSelectedListener. And then in this listener get the getPosition(). Something like this: tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener(){ @Override public void onTabSelected(TabLayout.Tab tab){ int position = tab.getPosition(); } }); UPDATE This method setOnTabSelectedListener() is deprecated . Use addOnTabSelectedListener(OnTabSelectedListener)