what does [-4:] means in python? I have learned in class that for Python, characters stars from [0]. For example in Monty Python, 'M'=0, 'o'=1, 'n'=2, 't'=3, 'y'=4, ' '=5, 'P'=6, 'y' = 7, 't' = 8, 'h'=9, 'o' = 10, and 'n' = 11.  But I am confused when I saw the following operation on NLTK:   genre_word = [(genre, word) for genre in ['news', 'romance']                             for word in brown.words(categories=genre)]  genre_word[:4] genre_word[-4:]   I thought all character numbering starts with [0]. What does the [-4:] means?
Understanding slice notation I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.
Ubuntu 17.10, changing input switching to alt-shift (with gnome-tweaks) creates problem in firefox I recently installed Ubuntu 17.10, and when I tried to set my keyboard layout to change with alt+shift, I hit a . There is  which works, but then it creates an unwanted behaviour on Firefox (perhaps other programs as well).   After setting alt+shift through gnome-tweak-tool as the combination to change language, whenever this combination is pressed within Firefox, it triggers a toggle that Firefox uses to show/hide the Menu Bar (with File/Edit/View etc.), and 'focus' is taken away from wherever the cursor was.   It's very frustrating, because one has to go and click again at the cursor.  The only solution I found was to permanently enable Menu Bar in Firefox because then alt doesn't do anything and I can use it to change languages. But I don't want to have Menu Bar on top always.  I hope you can understand what I'm trying to explain.  Any thoughts? I was peacefully playing GTA Online (yeah, was killing someone coming out of ls customs) then a hacker came and killed me using explosive ammos, I called him a hacker and he teleported to me and gave me 790k. I know that people get banned for receiving this kind of money, what should I do to avoid the ban? I was naively validating my binomial logit models by testing on a test dataset. I had randomly divided the available data (~2000 rows) into training (~1500) and validation (~500) datasets.   I now read a post in another thread ( Frank Harrell) that causes me to question my approach:     Data splitting is not very reliable unless you have more than 15,000   observations. In other words, if you split the data again, accuracy   indexes will vary too much from what you obtained with the first   split.   How serious is this worry and what are ways around it? The OP speaks of "resampling" but not sure how that works here for validation.   Edit: Adding context as per @Bernhard's comment below: I'm a newbie in WordPress. I'm trying to understand how it generates the XHTML pages. I guess it's the function of do_action( 'hook-name' ) , but I'm stuck with the understanding of the instruction isset( $wp_filter['all] ) when reading the function do_action because I don't understand what is the meaning of the word all.  Is it a PHP feature or a WordPress one? Lat/Long co-ordinates are not plotting onto EPSG:3857 OSM basemap correctly Excuse me if this is a stupid question, but I've honestly tried to find the answer in a few threads here on SE, and I cannot seem to follow the suggested steps correctly.    Project is in  (WGS 84 / Pseudo-Mercator) BaseMap (OpenStreetMap) layer is set to EPSG:3857 Vector data has been imported from CSV, and has Lat/Long coordinates, set to EPSG:3857.    The layer appears right in the middle of the map, around 0,0 obviously.   Why is this, what am I doing wrong? Get on what tile has mouse clicked How to use Noto Color Emoji with lualatex? I want to use Noto Color Emoji with lualatex (package fonts-noto-color-emoji on my box). However, this fails as follows. How to use Noto Color Emoji with lualatex?  \documentclass{article} \usepackage{fontspec} \setmainfont{Noto Color Emoji} \begin{document} 😺 👅  \end{document}   Error:  $ lualatex emoji.tex  This is LuaTeX, Version 1.07.0 (TeX Live 2019/dev/Debian)   restricted system commands enabled. (./emoji.tex LaTeX2e &lt;2018-12-01&gt;  luaotfload | main : initialization completed in 2.224 seconds (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2018/09/03 v1.4i Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (./emoji.aux) [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./emoji.aux))  409 words of node memory still in use:    3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 5 attribute, 48 glue_spec , 5 attribute_list, 1 write nodes    avail lists: 2:15,3:4,4:1,5:21,6:1,7:13,8:1,9:6 &lt;/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf ! error:  (file /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf) (ttf): sfnt  table not found !  ==&gt; Fatal error occurred, no output PDF file produced! Why is James Bond less tech savvy in the Daniel Craig movies? Meta duplicates don't require an answer. Don't suggest there is one when that's not true I have added a custom/secondary query to a template file/custom page template; how can I make WordPress use my custom query for pagination, instead of using the main query loop's pagination?  Addendum  I have modified the main loop query via . Why isn't pagination working, and how do I fix it? "Insufficient storage" when trying to install new app Let $M,N$ be $n \times n$ square matrices over an algebraically closed field with the properties that the trace of both matrices coincides along with all powers of the matrix. More specifically, suppose that $\mathrm{Tr}(M^k) = \mathrm{Tr}(N^k)$ for all $1\leq k \leq n$. The following questions about eigenvalues is then natural and I was thinking it would be an application of Cayley-Hamilton but I am having trouble writing out a proof.  How do we show that $M$ and $N$ have the same eigenvalues?  Added (because this question is now target of many duplicates, it should state its hypotheses properly). Assume that all the mentioned values of $k$ are nonzero in the field considered; in other words either the field is of characteristic $0$, or else its prime characteristic $p$ satisfies $p&gt;n$. How do I create files using the lines in a .txt file? For example I have a file called fileNames.txt.  cat &gt;fileNames returns  abet  able  abacus   How do I use fileNames to create abet, able, and abacus as .txt files?  I tried using pipes with cat and touch. How do I disable Aero Shake in Windows 7? I'm always accidentally minimizing most of my windows. This is really annoying. How do I disable Aero Shake? How to get Beamer Math to look like Article Math I've grown quite fond of HTTP reverse proxies in our development environment and found the DNS based virtual host reverse proxy quite useful. Having only one port (and the standard one) open on the firewall makes it much easier for management.  I'd like to find something similar to do SSH connections but haven't had much luck. I'd prefer not to simply use SSH tunneling since that requires opening port ranges other than the standard. Is there anything out there that can do this?  Could HAProxy do this? What does capital letter I mean in this formulas? Hello I don't understand meaning of the symbol represented by a capital letter "I" in the formulas below. There is  to the paper with the formulas.    At the beginning I thought it mean "where c is not equal to the result of classifier T(m)", however in step (d) there is a multiplication symbol before it, so it probably mean that "I" should "return" a value. Manual/automatic line breaks and text alignment in TikZ nodes Why is filling a balloon from your mouth much harder initially? Why is it that when you first fill up a balloon, it's hard to get air through, but after inflating it a bit, it becomes much easier to further inflate the balloon? How does item level and rarity affect the possible attributes?