OK I understand the basics, but can someone explain code copied from Greg's answer :  a[1::-1]   # the first two items, reversed a[:-3:-1]  # the last two items a[-3::-1]  # everything except the last two items, reversed   To me the first one reads: slice from 2nd position to end, then reverse it.  The second one is slice from beginning to the -2 position then reverse it.  The third one is slice from -3rd position to end then reverse it.  Obviously I am wrong since they work as suggested, but can you please tell me why?
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.
Prevent mail being marked as spam Citation colour with Beamer + Hyperref + Natbib I'm using natbib for citation with a custom bibstyle. I'm working on a presentation using LaTeX beamer and for some reason the citation marker doesn't have the colour that is specified to hyperref. The citation marker is black instead of green. I'll give you a MWE:    \documentclass{beamer} \hypersetup{   colorlinks,   citecolor=green,   linkcolor=red }  \usepackage{filecontents} \begin{filecontents}{mybib.bib} @ARTICLE{Bar2011,   author = {F. Foo and F. Bar},   title = {Foo and Bar},   journal = {Journal of Foo},   year = {2011},   volume = {1},   pages = {1--3} } \end{filecontents}  \usepackage[comma,numbers,sort&amp;compress]{natbib} \bibliographystyle{plain}  \begin{document} Dummy referefence to~\cite{Bar2011} \bibliography{mybib} \end{document}   For the purpose of the MWE I have selected the plain bibstyle, however, changing that to something else (including the custom style I want to use) doesn't affect the label colour.    Is there any patch for this problem? Is it possible to earn more than 100 lollipops per second? I have pumped my lollipop rate to 100/s, but it took a long time to go from 99 to 100. Is it even possible to get higher or should I stop? How can text selection be disabled in Android 3.0 Honeycomb? Proof of $\int_0^\infty \left(\frac{\sin x}{x}\right)^2 \mathrm dx=\frac{\pi}{2}.$ Shell Script to move folders containing a specific word I'm searching for an simple shell script to mv all folders in /var/www/uploads/ that containing Math or Physics in the name to /mnt/Backup/. Maximum total distance between points on a sphere What is the configuration (set of locations) of $n$ points on the surface of a sphere such that the sum of distances is maximum for $n=1,2,3,...$?  The sum of distances is measured by summing the lengths of every straight line (through the sphere) connecting every possible combination of $2$ points.  All the points are on a single sphere of radius $R$.  Here's a visualization:   Acknowledgements: Based on  Physics S.E. question. Image from . What are the Windows A: and B: drives used for? In Windows you have a C-drive. Everything labeled beyond that is with the following letter.   So your second drive is D, your DVD is E and if you put in a USB stick it becomes F and the following drive G. And so on and so forth.  But then, what and where are A and B-drives? I'm totally new to Ubuntu/Linux, using Ubuntu Server at the moment. Just trying to  figure out something basic.   How can you tell where you are installing a program. For example I just installed Sphinx search engine by placing the tarball that I downloaded from their site to my:  /home/sphinx   directory. I created the sphinx directory to place that tarball in. Then I ran these commands:  tar xvzf sphinx-0.9.8.1.tar.gz cd sphinx-0.9.8.1/ ./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql   and then these:  make sudo make install   Now I have a lot of files sitting in the directory where I ran these commands. Is this my Spynx installation or did it install somewhere else?  In windows if you run an installer (.exe file) anywhere the program will still install in your C:\Program Files directory. Does something similar apply to linux where all programs are installed in a central place, or can you install programs anywhere on the system.  Questions   I would prefer to keep all my installed programs in one place so what is the right place for this in terms of best practice. In other words what is the Linux equivalent of C:\Program Files? And how does one always install at this location, is it just a matter of placing the tarball and running the install commands from this location? What about if I use sudo apt-get to install a package. How can I point to this location to tell apt-get to always install there? Taking advantage of one-time pad key reuse? How do you fix a bad merge, and replay your good commits onto a fixed merge? Reinstall Windows 8 on a Windows 8 based system with embedded key I'm a computer technician and we started selling few Windows 8 machine. We saw the new COA label does not show the key and after reading a little bit online, realized those systems came with the key emmebeded in the eUFI BIOS.   My question is : How do I reinstall Windows 8 if the hard drive is crashed? I kind of get that you can install it with a media and the media should activate the licence embedded. What is the media required? Is a retail DVD is able to do the work or do I need a system builder kit? I understand the manufacturer is reponsible to provide media  or replace the failed drive under the warranty but what will happen when warranty expire? I'll have to sell a full windows 8 licence with a key?  Thanks If $\mathrm{Tr}(A)=0$ then $T=R^{-1}AR$ has all entries on its main diagonal equal to $0$ Prove that if $A$ is a square matrix and $\mathrm{Tr}(A)=0$, then there exists an invertible matrix $R$ such that the matrix $T=R^{-1}AR$ has all entries on its main diagonal equal to $0$.   It seems like the formula $A=S\Lambda S^{-1}$, but maybe it does not help.  Thanks so much. How do I delete a folder that's in use? Sometimes when I'm working in Windows I'll get this prompt when I try to delete a directory:    Folder In Use The action can't be completed because the folder is open in another program Close the folder and try again.   However, the folder isn't "in use" at all, and I don't have it open. So how can I delete it short of rebooting? My Arcpy code is not working in ArcMap 10.1 because an error with the last line:      Error 000824: The tool is not licensed.    I have all my extensions turned on, so I don't know why I would be getting this error. It seems I only need to import arcpy.sa.   Did I do this correctly, or are there other modules that should be imported for this code to work?  import arcpy, os, string, glob, sys from arcpy import env from arcpy.sa import *  env.workspace = r"C:\VMshared\small_example_valley8\SD2part" outFolder = r"C:/VMshared/small_example_valley8/SDpartINT/INT"  for rasterFile in arcpy.ListRasters("*.tif"):     oName, oExt = os.path.splitext(rasterFile + ".tif")     outRaster = os.path.join(outFolder, oName + ".tif")      arcpy.gp.Int_sa(rasterFile,outRaster) I've noticed a distressing tendency for questions that seem basic or overly short to be immediately closed and downvoted into oblivion.  Case in point:   Within a minute of being asked, this question received 12 downvotes and was closed as "not a real question".  That particular question is a very real, non-trivial question, but it had somewhat poor grammar and looked a little like a much simpler question.  Can we try to be a little more accepting? Separate Biblatex bibliographies with newest entry and highest reference number at the top I would like to have a similar biblatex behaviour as described , i.e. separate bibliographies for different publication types, each bibliography should 1) be prefixed with a corresponding label (C for conference publications, J for journals etc), 2) sorted so that the newest entry is at the top (defined by the publication year) and 3) with reference numbers sorted in descending order per bibliography, i.e. the newest entry should have the highest number.  Journal articles ---------------- [J3]    reference from 2017 [J2]    reference from 2016 [J1]    reference from 2015  Conference publications ----------------------- [C4]    reference from 2017 [C3]    reference from 2017 [C2]    reference from 2016 [C1]    reference from 2015   I currently have the following:  \usepackage[backend=biber,         isbn=true,         giveninits=true,         style=numeric,         maxnames=99,         sorting=ydnt,         defernumbers=true,         autocite=superscript]{biblatex}  \subsection*{Journal articles} \begin{refcontext}[labelprefix=J] \printbibliography[type=article] \end{refcontext}  \subsection*{Conference publications} \begin{refcontext}[labelprefix=C] \printbibliography[type=inproceedings]   Separate bibliographies works fine, labelprefix also works as desired, sorting by year in descending order as well. However, if I try the solution mentioned in the above question I get very high reference numbers (in the 500s).  Is the above behaviour possible at all and, if yes, what is the most elegant solution using current biblatex etc.?  Thanks a lot in advance! Can the term "etymology" be applied to a phrase or only individual words? I have always heard the term used in referring to a single word. When browsing questions on this site, I've seen it used applied to entire phrases, and have suppressed the compulsion to edit them and replace the term with origin. I admin a handful of cloud-based (VPS) servers for the company I work for.   The servers are minimal ubuntu installs that run bits of LAMP stacks / inbound data collection (rsync). The data is large but not personal, financial or anything like that (ie not that interesting)  Clearly on here people are forever asking about configuring  and such like.   I use a bunch of approaches to secure the servers, for example (but not restricted to)   ssh on non standard ports; no password typing, only known ssh keys from known ips for login etc https, and restricted shells (rssh) generally only from known keys/ips servers are minimal, up to date and patched regularly use things like rkhunter, cfengine, lynis denyhosts etc for monitoring   I have extensive experience of unix sys admin. I'm confident I know what I'm doing in my setups. I configure /etc files. I have never felt a compelling need to install stuff like firewalls: iptables etc.  Put aside for a moment the issues of physical security of the VPS.  Q? I can't decide whether I am being naive or the incremental protection a fw might offer is worth the effort of learning / installing and the additional complexity (packages, config files, possible support etc) on the servers.  To date (touch wood) I've never had any problems with security but I am not complacent about it either. Kernels and reduced row echelon form - explanation The following text is written in my textbook and I don't really understand it:     If $A = (a_{ij}) \in$ Mat$(m x N, F)$ is a matrix in reduced row echelon form with $r$ nonzero rows and pivots in the columns numbered $j_1 &lt; ... &lt; j_r$, then the kernel ker$(A)$ is generated by the $n-r$ elements $ w_k = e_k - \sum\limits_{1 \le i \le r, j_i \le k} a_{ik}e_{j_i}$ for $k \in {1, \cdots , n} \ {j_1, \cdots, j_r}$, where $e_1, \cdots, e_n$ are the standard generators of $F^n$.    There are no computational examples and the notation is a bit overwhelming so I don't know how I can use it. Can somebody give an example of this in practice?