How to split a string in Python by 2 or 3, etc
Split string every nth character?
If $\operatorname{rank}\left( \begin{bmatrix} A &B \\ C &D \end{bmatrix}\right)=n$ prove that $\det(AD)=\det(BC)$ Let $A,\ B,\ C,\ D \in \mathcal{M}_n(\mathbb{C})$. If $\operatorname{rank}\left( \begin{bmatrix} A &amp;B \\ C &amp;D \end{bmatrix}\right)=n$, prove that $\det(AD)=\det(BC)$. I've been working a bash script to automate the process of opening and closing an LVM over LUKS external hard drive. However I continue to receive errors on line 28:   $(vgchange -a n ; cryptsetup luksClose vol)   The error I receive:  $ sudo ./encryption.sh -l Locking System.............. ./encryption.sh: line 28: 0: command not found System Locked!   Here is the rest of the code for reference:  if [ $1 = -u ] ; then     $(cryptsetup luksOpen /dev/sdb2 vol)     echo "Unlocking.................." | pv -qL 10     $(mount /dev/mapper/vol-lvroot /mnt ; mount /dev/mapper/vol-lvvar /mnt/var ; mount /dev/mapper/vol-lvhome /mnt/home ; mount /dev/sdb1 /mnt/boot)     echo "System Mounted!" | pv -qL 10 #   exit 0 fi  if [ $1 = -l ] ; then     $(umount /mnt/var ; umount /mnt/home ; umount /mnt/boot ; umount /mnt/)     echo "Locking System.............." | pv -qL 10     $(vgchange -a n ; cryptsetup luksClose vol)     echo "System Locked!" | pv -qL 10     exit 0 fi   Other information:   I receive no apparent error when running the command in question by itself interactively. I'm new to writing bash, so any recommendations and constructive criticism is appreciated. The process appears to complete successfully, but I don't understand the error or how to make them go away. Upon further research when running the troubled code alone in interactive mode it does provide output after being executed.   This is given after posting the troubled code interactively.   0 logical volume(s) in volume group "vol" now active I have to show by induction that this function is a multiple of 8. I have tried everything but I can only show that is multiple of 4, some hints? The function is $$5^{n+1}+2\cdot 3^n+1 \hspace{1cm}\forall n\ge 0$$, because it is a multiple of 8, you can say that$$5^{n+1}+2\cdot 3^n+1=8\cdot m \hspace{1cm}\forall m\in\mathbb{N}$$. Create a .desktop file that opens and execute a command in a terminal If you make a search for something that returns more than 10,000 items in result. For example, search for  return 161,338 results on MSE. But if you select a page where 10,000+ result should be shown:        In the edge case  shows zero results:        But this is actual for any page where per_page * page_number is more than 10,000.  Though this does not happen for Stack Overflow in English. It looks like all other sites are affected.  Related bug report on ruSO.meta: Is there an alternative to Cantor's cardinalities that makes proper subsets smaller than their sets? Cantor defined an infinite set as a set whose subset can be placed in a one-to-one correspondence with its subset. That is, take the set of all natural numbers: {0, 1, 2, 3, 4,...}. From that set, you can form a subset of all even numbers: {0, 2, 4, 6,...}. There is a one-to-one correspondence between both these sets. After all, you can multiply each member in the set of all natural numbers by 2, and you’ll get the set of all even numbers. Because of this one-to-one correspondence, the two sets have the same cardinality, despite the set of even numbers being a subset of the set of natural numbers. This is counter-intuitive to me. How can a subset of a set be as big as the set itself? To make the intuition more concrete, consider the set of multiples of 1,000,000: {0, 1,000,000, 2,000,000,...}. There is a one-to-one correspondence between this set and the set of all natural numbers. So they have the same cardinality. This is really counter-intuitive.  From as far as I can tell, there are basically two axioms at play here:  A1: If all members of set A can be placed in a one-to-one correspondence with all the members of set B, then both sets have the same cardinality.  A2: If set A is a proper subset of set B, then A has a smaller cardinality than set B.  How Cantor defined infinite sets is that he accepted A1 and rejected A2. That is counter-intuitive to me. But mathematicians might say that my intuition is just wrong. So my question is whether we can define infinite sets in another way, i.e. accept A2 but reject A1. That is, the set of even numbers is smaller than the set of all natural numbers, even though both sets have a one-to-one correspondence. If you think this is counter-intuitive because sets with one-to-one correspondence with each other should have the same cardinality, and thus think this is wrong, why can’t I say the same when Cantor accepted A1 and rejected A2? Either way, there is something counter-intuitive and paradoxical.   So, my questions are:   Can we accept A2 and reject A1 for the definition of an infinite set? What arguments, if any, are given for accepting A1 and rejecting A2? I have purchased a rather large bag of long-grain white rice (25 lbs.) and need to know the best way for storing it long-term. This rice will be used as both a food-storage food source and as my everyday source of rice for cooking, so the storage solution should (hopefully) be resealable, rather than once-it's-open-it's-open. I eat rice maybe three times a month, so it isn't really "everyday" but it will be my go-to when I have it. My current employer has given me the opportunity to design my own GIS workstation. The problem is I have no idea what is important when it comes to hardware! I have been given a datasheet from Fujitsu which includes the latest CELSIUS M720 series workstations but the configuration includes about 30 different processors, graphics cards, and hard drives.  I will be working a lot with the ESRI desktop suite (spatial analyst and 3D analyst) and doing a fair amount of raster processing (DEMs, visibility analysis, etc.), but I also use the GDAL library, SAGA-GIS, Quantum GIS and others.  Does ArcGIS 10 actually use multiple cores?  I have the choice from 4 cores with 8 threads up to 8 cores with 8 threads - 16 threads?  Is SSD SATA III better than HDD SATA III?  The Celsius R920 supports up to 512 GB RAM. But what do I need?  It will probably be the last time I get a new workstation for the next 5 years, so I am curious what others have ordered or feel will be necessary for the coming years. Obviously the cloud isn't taking over as quick as they say! Can TikZ create pixel art images? Can you create images like this:    when you have something like  0 = green (#54ff00) 1 = white (#ffffff) 2 = red   (#ff0000) 3 = blue  (#0048ff)  Image (Python list of integers defined above): [[2,0,0,0,0,0,0],  [0,3,0,0,0,0,0],  [0,3,2,1,1,0,0],  [0,3,2,2,2,1,1],  [0,3,2,0,0,1,0],  [0,0,0,0,0,1,0],  [0,0,0,0,0,1,0]]   with TikZ?  How far I got  The following MWE defines all colors, produces a grid of the correct size (though the size is determined by hand):  \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{tikz} \usepackage{xcolor}  \begin{document}     \newcommand\n{7}     \definecolor{green}{HTML}{54FF00}     \definecolor{wite}{HTML}{FFFFFF}     \definecolor{red}{HTML}{FF0000}     \definecolor{blue}{HTML}{0048FF}     \begin{tikzpicture}         \foreach \x in {1,...,\n}{             \foreach \y in {1,...,\n}{                 \begin{scope}[shift={(\x,\y)}]                   \draw [fill=green] (0,0) rectangle (1,1);                 \end{scope}             }         }     \end{tikzpicture} \end{document}   Of course, I could simpy make a lot of adjusted                   \begin{scope}[shift={(\x,\y)}]                   \draw [fill=green] (0,0) rectangle (1,1);                 \end{scope}   but I've wondered if this can (with reasonable effort) be done in TikZ / LaTeX.  My problem is giving TikZ the color array. I don't have any idea how to do this. I only know two types of looks in TikZ:  \foreach \x in {0,1,2,3,4,5}{...} \foreach \number in {1,...,\n}{...}   I have never seen a nested over a 2D-array. All I have seen so far were 1D-Arrays of tuples (with fixed tuple size). Local anchor for group master (move/translate/offset of group master moves group instances)? Let's say I start with the default Blender (2.64) file, except I set the cube to be 1 for all dimensions. At that point, the cube is at xyz location (0,0,0).  Then, let's say I select the cube with right mouse button, and go to Object / Group / Create New Group, and confirm the name "Group" in the "Create New Menu" bar with [Enter]. The selection outline turns green, meaning it's a group "master" (as far as I can see).  Now, let's say I press Shift-A; and choose "Group Instance" > "Group", and set the new instance to Z=2.3; with all selected, the view looks something like this:    Now, let's say I deselect all with A, then select the group master with right-click; and let's say I move it to Y=-2; then the result is:    ... that is, it is noticeable that the group instance/clone also moved in respect to its center (note the group instance axes, which remain in the set position)! Which means, I guess, that groups are defined in respect to the global coordinate center (0,0,0) as anchor.   My question is: is it possible to define a group, but in respect to the, say, bounding box center of the group as anchor - such that when I move/translate the group master, the group instances would remain anchored at their set position (basically, at the center of the group instance axes)? Also, is this documented anywhere in Blender documentation (I had problems finding this info)? How do I check if a list is empty? For example, if passed the following:  a = []   How do I check to see if a is empty? Problem with gummy-bears being too much like jelly I've been trying a simple recipe I found on the internet, which is a simple recipe consisting mostly of gelatin.  The problem is that the end result is basically just a fruit-flavoured jelly (Jell-O?), rather than the more chewy gummy-bears (Haribo) style of jelly confectionery.  Can anyone suggest what I need to do to make them less springy and more chewy.  It's all difficult to articulate!  Here's what I used for the first test-batch:   12 tbsp sugar 12/3 cup fruit juice 8 tbsp Golden Syrup 8 tbsp gelatin   soften the gelatin in 1/2 cup of cold water. place sugar, syrup and the juice in a pan and gently heat until sugar dissolves. Stir in the gelatin and stir until dissolved. Pour into moulds and wait until set.    Thanks This is a hypothetical question about how a CPU operates. If I purchase two identical CPUs, and use one long term (say one year), will it be identical in speed to the unused CPU? Will the number of clock cycles, latency of requests, etc on the used CPU be less than that of the unused CPU?  A supporting argument may be that mechanical devices degrade over time, While a CPU has no moving parts (other than the external fan), it does have circuits that can be damaged by heat, and voltage spikes. Lets say that after a year of intensive use, the circuits degrade and fewer electrons can pass since the pathway is narrower, etc.   Is this the nature of how a CPU operates, or is it simply working or broken, with no speed degradation in between? I keep having to re-install Ubuntu after trying advice.  This is very frustrating.  All I want is to boot to a Linux command prompt.  Please help! Sometimes, others just inform us about things without us asking them, other times they do not do that even if we ask them. I want a verb for when others do not give us information — whether because they do not like to or they just don't give it, but we cannot directly ask them to — but we actively extract the information from them sometimes without them being aware of it.   So the word I am looking for shouldn't be only for cases where we coerce or force others to give us information, and it shouldn't be only for cases where others do not like to give us information.  Example:     I needed that information. But I couldn't ask her for it, or most   probably she would not give to me even if I asked her. So, I ....   the information I wanted.   It could be a phrasal verb and so not just a single word, but I couldn't devise a  blank suitable for all possibilities!   Two verbs I've already had but I think are not suitable:  to give someone the third degree   To prize something from/out of somebody How to upgrade to MySQL 8.0? I have a Drupal site 8.6.10 on an Ubuntu server 18.04 with MySQL 5.7.25  I want to update MySQL to version 8.0  Here are the steps I followed :   I backed up my database. I uninstalled MySQL from my server with the commands :  $ sudo systemctl stop mysql $ sudo apt remove mysql-* $ sudo apt purge mysql-* $ sudo apt autoremove $ sudo dpkg -l | grep mysql | grep ii  I added the repository with the command :  $ wget https://repo.mysql.com//mysql-apt-config_0.8.12-1_all.deb  I installed the package with the command :  $ sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb            My problem :   I install MySQL with the command :  $ sudo apt update $ sudo apt install mysql-server    When I do step 5, it installs MySQL 5.7 why does not it install version 8 ? prevent "action" if top of page I have a manual list of stuff that are sometimes separated by an hrule(or my own custom ruler) for visual purposes.  Sometimes the hrule ends at the top or bottom of a page which makes it useless.  Is there a way to prevent it from being added if it is at the top or bottom of a page?    MWE of problem:  \documentclass{book} \usepackage{tikz} \begin{document} \newcommand\rulesep{%   \par % make sure we end a paragraph   \vskip5pt % space above the rule   \leaders\vrule width \textwidth\vskip0.4pt % rule thickness is 0.4pt   \nointerlineskip % disable interline glue here   \vskip5pt % space below the rule } \def\dotikzcircle#1{\begin{tikzpicture}\draw(0,0)circle(#1);\end{tikzpicture}} \rulesep \noindent This is a test\noindent \rulesep \noindent End of test \rulesep \dotikzcircle3 \rulesep \begin{center}\dotikzcircle3\end{center} \rulesep \begin{center}\dotikzcircle3\end{center} \rulesep \dotikzcircle1 \rulesep \dotikzcircle2 \rulesep \dotikzcircle3 \rulesep \dotikzcircle4 \rulesep \dotikzcircle5 \rulesep  \end{document} Several responses to a question  suggested I try Opera kiosk mode, so I decided to download it and give it a try. Once the download had completed and the disk image was being verified, Safari hung for over a minute and there were periods where Safari used a very high %CPU:    In Mac OS X 10.5, I was accustomed to seeing Safari freeze, but it never used up more than 200% CPU (2 cores x 100%). Is this a bug in Activity Monitor? Or does this mean that %CPU is now more akin to ? Subscribe to tags I am interested in? How do I subscribe to the tags that I am interested in?  I like to get notified via email or so, when someone asks new questions or if someone responds to my questions. Equivalence between least squares and MLE in Gaussian model I am new to Machine Learning, and am trying to learn it on my own. Recently I was reading through  and had a basic question.   Slide 13 says that "Least Square Estimate is same as Maximum Likelihood Estimate under a Gaussian model". It seems like it is something simple, but I am unable to see this. Can someone please explain what is going on here? I am interested in seeing the Math.   I will later try to see the probabilistic viewpoint of Ridge and Lasso regression also, so if there are any suggestions that will help me, that will be much appreciated also.