Reverse last i element in array python
Understanding slice notation
I am trying to make a snowball that triggers a command when it hits a player in 1.15, but I don't know how to do that. When I do execute at @e[type=snowball] run gamemode spectator @a[distance=..2] it only runs the command if it goes right next to them. Controlling Volume Mixer How Do You Select Only Part Of a Timeline To Be Rendered? Let's say I only want a section of the timeline to be rendered, and I want the final output to be in RAW AVI format.  How would you do that? Thanks guys! Factorial Inequality problem $\left(\frac n2\right)^n > n! > \left(\frac n3\right)^n$ I met an inequality, I ask, do not mathematical induction to prove that:     Prove \[ \left(\frac n2\right)^n > n! > \left(\frac n3\right)^n \] without using induction Wrong numeration in toc longer then one page I tried anything I could find with \cleardoublepage and \newpage and so on; mostly they use \addcontentsline. I don't need to use it as listof=totoc already puts it into the toc so even if I use \addcontentsline instead I get the same result.  \documentclass[     fontsize=11pt,     DIV10,     ngerman,     paper=a4,      twoside=false,     titlepage,     parskip=half,     listof=totoc,     bibliography=totoc,     index=totoc,     captions=tableheading,     foottotes=multiple,     final ]{scrartcl}  \usepackage[     automark,     headsepline,     ilines ]{scrpage2}  \usepackage[ngerman]{babel} \usepackage[babel,german=quotes]{csquotes} \usepackage[dvips]{graphicx}  \begin{document}  \ofoot{\pagemark} \pagenumbering{Roman} \clearpage \tableofcontents \clearpage \listoffigures \clearpage \pagenumbering{arabic} \section{Test} \label{sec:Test}  Test  \subsection{Test} \label{sec:Test}  \begin{figure}[H]  \centering \caption{Testfig} \label{fig:testfig} \end{figure}  \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test} \subsection{Test} \label{sec:Test}  \end{document} When does the amount of skew or prevalence of outliers make the median preferable to the mean? I know that "deviations in the data are devil", and when the distribution is highly skewed, it is better to consider median as average rather than mean, but how to decide these hard-limits.  For example:   CASE 1:   Assume X = 10,20,30,40,50,60,70 In this case, I think that it is better to use mean and that it will give very accurate results.  CASE 2:   Assume X = 10,20,30,40,50,60,70,7000 In this case, I think that it is better to use median instead of using the mean.  CASE 3:    Assume X = 10,20,30,400,500,600,700 In this case, I think it is better to use IQR (Inter Quartile Range)    But I'm stuck with how to decide these hard-limits i.e. which to use in which condition, in general.   I've found a tool working on subjected principle, which takes context-less sample-distribution as input and determines whether mean is close/moderate or against the null-hypothesis.  Find References:-     (For Mean Test)  (For Median Test)   What I'm really looking is a good answer which states how to derive these conclusions. Can a script modify an environment variable of its calling shell? I am setting my JAVA_HOME in my ~/.bashrc file.  Now, I need to create a script that will change the JAVA_HOME just for the current terminal, so that I can start an app that needs java 5.  I have created this script to do this task, but after finishing, I can see that JAVA_HOME is not updated  export JAVA_HOME=/usr/lib/jvm/java-5-oracle/ export PATH=$PATH:$JAVA_HOME       Here is the result  $ ./javaHome5.sh $ echo $JAVA_HOME /usr/lib/jvm/java-6-oracle/   I think that the reason this is not being applied, is that a script is executing in it's own terminal, so when the script ends, the current terminal will not be affected.  Currently, the only way I've found around this is:   Edit my ~/.bashrc and change the JAVA_HOME var Run source ~/.bashrc to apply the changes in current terminal. Which again cannot be applied in a script, as the source command needs to be run in the current window.   Needless to say, this change applies to all new terminal windows, so I practically need to do this twice: One before starting my app, and one more time right after this, just to restore the environment vars to their default. That's not really convenient.  Do you have any ideas how can I change this var using a script? A new search engine for Stack Exchange Why does the aorta spray blood when atmospheric pressure is higher than blood pressure? Are delphi variables initialized with a value by default? Combinatorial proof for Stirling number of 1st kind's generating function So I see this identity a lot but I can't find a detailed combinatorial proof for it.  $$n(n+1)...(n+k-1)=\sum_{j=0}^k \begin{bmatrix}k \\j \end{bmatrix}n^j$$ Can someone please help? What is the best way to initialize a private, static data member in C++?  I tried this in my header file, but it gives me weird linker errors:  class foo {     private:         static int i; };  int foo::i = 0;   I'm guessing this is because I can't initialize a private member from outside the class.  So what's the best way to do this? What's the difference between the five masses: inertial mass, gravitational mass, rest mass, invariant mass and relativistic mass? PermGen elimination in JDK 8 WMI object to get current sessions with client name? Shell Type:  &gt;echo $SHELL /bin/ksh   Cronjob :   15 * * * * /bin/ksh /wls_domains/resMGT/logs/bea/wlr3queuetransaction.sh &gt; /wls_domains/resMGT/logs/bea/data/script.log  The script is as below:  ##log files and lookup file "wlr3queue.txt" are in the same path of the script ##/wls_domains/resMGT/logs/bea/wlr3queuetransaction.sh  Script :  #!/bin/ksh  dt=`date +%Y-%m-%d` xy=`date|awk '{print $4}'|awk -F":" '{print $1}'` yz=`expr $xy - 1` if [ $yz -le 9 ] then yz=0$yz fi  if [ $xy -gt 0 ] then  for i in `cat wlr3queue.txt` do  sum=0  count=`gzgrep -i "$dt" admin_resMGT_access.log* | grep "$yz:[0-5][0-9]" | grep "$i" | wc -l`  if [ $count -gt 0 ] then name=`echo $i | cut -d'/' -f3`  gzgrep -i "$dt" admin_resMGT_access.log* | grep "$yz:[0-5][0-9]" | grep "$i" | awk '{print $8}' &gt; consumed_time.txt  for j in `cat consumed_time.txt` do j_ms=`echo "$j * 1000" | bc` echo $j_ms &gt;&gt; consumed_ms_time.txt done  for k in `cat consumed_ms_time.txt` do sum=`echo "$sum + $k" | bc` done  avg=`echo "scale=2; ($sum/$count) "| bc`  min=`cat consumed_ms_time.txt | sort -n | head -1`  max=`cat consumed_ms_time.txt | sort -n | tail -1`  else  avg=0  min=0  max=0  fi ( echo $yz","$count","$avg","$min","$max )&gt;&gt;/wls_domains/resMGT/logs/bea/data/$name$dt.csv   rm -f consumed_ms_time.txt  done  else  echo "script won't execute at this hour" &gt; temp.txt  fi   I have executed the following commands and the script ran successfully.  ./wlr3queuetransaction.sh sh -x wlr3queuetransaction.sh /bin/ksh /wls_domains/resMGT/logs/bea/wlr3queuetransaction.sh  /bin/ksh/ wlr3queuetransaction.sh.   How to debug? What to do? How do I sort a two-dimensional (rectangular) array in C#? I have a two-dimensional array (of Strings) which make up my data table (of rows and columns).  I want to sort this array by any column.  I tried to find an algorithm for doing this in C#, but have not been successful.  Any help is appreciated. Evaluating the infinite product $\prod\limits_{k=2}^\infty \left ( 1-\frac1{k^2}\right)$ It is often stated, particularly in popular physics articles and videos, that if one measures a particle A that is entangled with some other particle B, then this measurement will immediately affect the state of the entangled partner.  For example, if Alice and Bob share an entangled pair of electrons and Alice measures her spin in the $x$ direction, then Bob's spin will also end up spinning in that direction, and similarly if she measures in the $z$ direction. Moreover, the effect will be instantaneous, regardless of the spatial distance between the two particles, which seems at odds with special relativity.  Can I use a scheme like this to communicate faster than light? Bevel specific edges