Python's length of list can be calculated by len(a_list). My question is, why was a_list.len() not implemented? Is there a reason behind it?
I know that python has a len() function that is used to determine the size of a string, but I was wondering why it's not a method of the string object.  Update  Ok, I realized I was embarrassingly mistaken. __len__() is actually a method of a string object. It just seems weird to see object oriented code in Python using the len function on string objects. Furthermore, it's also weird to see __len__ as the name instead of just len.
Complete residue system proof I was given a proof of this in class, but it does not make sense to me, can someone provide a better proof, or explain the one I have provided, thanks.  Suppose $\gcd(a,n) = 1$, where $a$ and $n$ are natural numbers. Prove that $0$, $a$, $2a$, $3a,\ldots, (n-1)a$, is complete residue system modulo $n$.  Proof given in class:  \begin{align*} ka &amp;\equiv ra \pmod{n}\\ &amp;\Rightarrow  k \equiv r \pmod{n}\\ &amp;\Rightarrow  \text{$k-r$ divides $n$}\\ &amp;\Rightarrow \text{$k=r$ because $0\leq k\lt n$, $0\leq r\lt n$} \end{align*} Deriving the conditional distributions of a multivariate normal distribution We have a multivariate normal vector ${\boldsymbol Y} \sim \mathcal{N}(\boldsymbol\mu, \Sigma)$. Consider partitioning $\boldsymbol\mu$ and ${\boldsymbol Y}$ into  $$\boldsymbol\mu = \begin{bmatrix}  \boldsymbol\mu_1 \\  \boldsymbol\mu_2 \end{bmatrix} $$ $${\boldsymbol Y}=\begin{bmatrix}{\boldsymbol y}_1 \\  {\boldsymbol y}_2 \end{bmatrix}$$  with a similar partition of $\Sigma$ into $$  \begin{bmatrix} \Sigma_{11} &amp; \Sigma_{12}\\ \Sigma_{21} &amp; \Sigma_{22} \end{bmatrix} $$ Then, $({\boldsymbol y}_1|{\boldsymbol y}_2={\boldsymbol a})$, the conditional distribution of the first partition given the second, is  $\mathcal{N}(\overline{\boldsymbol\mu},\overline{\Sigma})$, with mean $$ \overline{\boldsymbol\mu}=\boldsymbol\mu_1+\Sigma_{12}{\Sigma_{22}}^{-1}({\boldsymbol a}-\boldsymbol\mu_2) $$ and covariance matrix $$ \overline{\Sigma}=\Sigma_{11}-\Sigma_{12}{\Sigma_{22}}^{-1}\Sigma_{21}$$  Actually these results are provided in Wikipedia too, but I have no idea how the $\overline{\boldsymbol\mu}$ and $\overline{\Sigma}$ is derived. These results are crucial, since they are important statistical formula for deriving Kalman filters. Would anyone provide me a derivation steps of deriving $\overline{\boldsymbol\mu}$ and $\overline{\Sigma}$ ? Thank you very much! I have a list/queue of 200 commands that I need to run in a shell on a Linux server.   I only want to have a maximum of 10 processes running (from the queue) at once. Some processes will take a few seconds to complete, other processes will take much longer.   When a process finishes I want the next command to be "popped" from the queue and executed.  Does anyone have code to solve this problem?  Further elaboration:  There's 200 pieces of work that need to be done, in a queue of some sort. I want to have at most 10 pieces of work going on at once. When a thread finishes a piece of work it should ask the queue for the next piece of work. If there's no more work in the queue, the thread should die. When all the threads have died it means all the work has been done.  The actual problem I'm trying to solve is using imapsync to synchronize 200 mailboxes from an old mail server to a new mail server. Some users have large mailboxes and take a long time tto sync, others have very small mailboxes and sync quickly. I am trying to sniff on a custom SPI-like bus protocol, which uses a unified bidirectional data line instead of separate MISO/MOSI. To make sense of the communication, I need to split it up into unidirectional lines before feeding them to my logic analyzer. Otherwise I wouldn't be able to see which device is responsible for which part of the signal. Since my devices won't talk to each other unless the protocol is carried out correctly, it's obvious that the bus splitting device has to be transparent to the actual agents communicating.  I tried to construct a bus splitting device, but failed as described . Since this question was maybe too specific and has not been answered, I want to ask more generally: Is there a bidirectional bus splitter that is able to split  into four wire SPI? Where could I buy such a device? (This seems similar to  question, only that I'm not talking about two really different protocols, so the answer does not apply). In principle only getting one direction would also suffice, since I could just subtract it from the full signal in order to retrieve the other half. And I'm also only interested in the master side of the communication.    The  seems to be a good candidate. Although it's advertised for use with I2C, it seems to be agnostic to the actual protocol on the lines. (As it does not even differentiate between DATA and CLOCK line for I2C.)     Splits I2C-bus signal into pairs of forward/reverse Tx/Rx, Ty/Ry signals for interface with opto-electrical isolators and similar devices that need unidirectional input and output signal paths.   As my devices operate on SPI mode 3 (polarity 1, idling on HIGH), the implementation of the receive pin should work:        sense the voltage state of the I2C-bus pin Sx (or Sy) and transmit this state to the pinTx (Ty respectively), and   sense the state of the pin Rx (Ry) and pull the I2C-bus pin LOW whenever Rx (Ry) is LOW.      But I am still puzzled on how this would actually work in sniffing this bidirectional bus. I could connect one device with the I2C line and grab its MOSI at Tx and MISO at Rx, but I would eventually have to connect both lines before feeding it to the other device, therefore making it impossible to separate the signals at my logic analyzer again. How can I connect the Tx/Rx for the slave while still being able to read them separately with a third device?  Edit: I now think this is actually not helping at all, since it leaves me with the same splitting issue as with out the device. I already have separate master and slave lines, I just don't know how to join them while still retrieving the separate directions.    I also stumbled upon the . It seems like this is a device designed for sniffing on buses, but I don't think it can help me in my case. Is there a mode where I can use it as a bridge on a bidirectional line and grab unidirectional signals off of it simultaneously?    Edit: I found this  which seems related to the issue. This does supposedly split the bidirectional line to feed it to two unidirectional isolators. The question is: Does this work for my setup? It describes the I2C lines being open-drain, whereas my lines are open-collector and also I'm not entirely sure if I could just leave out the isolator part and grab the signals from the lines or if these would have to be also hooked up to some transistor or be pulled high. I have two partitions that I want to mount on startup: /dev/sda3   /mnt/devel  ext4    defaults    0   2 /dev/sda2   /mnt/excess ntfs    defaults    0   2  The ext4 partition mounts fine (owned by me, writable only by me), but the NTFS mounts owned by root with R\W permission for all. How to fix this? drwxr-xr-x  7 amanda amanda 4096 2012-03-14 19:07 devel drwxrwxrwx  1 root   root   4096 2012-03-14 22:38 excess Were there any improvements to the second Death Star (other than the change in exhaust port) that we know of? What is the difference in meaning among these sentences? Walking is good exercise. Walking is a good exercise. Walking is a good form of exercise.     I'd like to know the difference in meaning among these sentences. Thanks a lot. How to change the desktop wallpaper to a photo of my own selection in Ubuntu 18.04? I'm not interested in downloading some wallpaper changer application, nor am I interested in coding something up. There has to be an easy way to select a photo as a custom wallpaper in Ubuntu 18.04. Do I need a UK visa? How and where to apply? My MacBook Pro has a flashing question mark in a folder against a grey background My MacBook Pro shows a grey screen with a flashing question mark in a folder. I tried connecting it to an older MacBook using firewire cable. I restarted the Macbook Pro in Target Mode. Now I see Thunderbolt and Firewire icons flashing and moving in a grey background. There is a green power icon at the bottom as well. I am not an expert even though I have been using Macs for ages.  How can I fix this issue so I can recover/backup things in the MacBook Pro hard drive? Order of operations using Object Initializer Syntax Does the order in which I set properties using the object initializer syntax get executed in the exact same order?  For instance if I do this:  var s = new Person { FirstName = "Micah",                      LastName = "Martin",                      IsLoaded = true                    }   will each property get set in the same order? How do I generate random integers within a specific range in Java? What is the best way to remove and prevent leaf stains on concrete pavers? I need to read a properties files that's buried in my package structure in com.al.common.email.templates.  I've tried everything and I can't figure it out.  In the end, my code will be running in a servlet container, but I don't want to depend on the container for anything. I write JUnit test cases and it needs to work in both. How can I visualize which folders and files are taking up all of the space on my hard drive?  I'm getting some conflicting reports on the size of hard drive contents. Namely what is and isn't there and what folders are actually using the space.   I need to know which of the files or folders the culprits behind all this hidden bloat. Also there should be a print option to get it on paper. How to encrypt folders (not in Home)? Is there a way to encrypt a folder, which is not in Home (/home/user/) but even in a different partition, so only my user can access/read contained files?  Alternatively, I would like to understand if it is possible to turn a complete ext4 partition into an encrypted volume, which would be mounted at user login.  If possible, I would like to make the change without reinstalling Ubuntu.  My PC has (mount output):  /dev/sda1 on / type ext4 (rw,errors=remount-ro) /dev/sda3 on /home type ext4 (rw) /dev/sda4 on /home/igor/Personale type ext4 (rw)   sda4 is the partition containing folders I would like to protect. I am a newbie in linux and I don't know how to open the Ubuntu Software Center via Terminal!! Please help A Strict Sense Stationary (SSS) process implies it is a Wide Sense Stationary (WSS) process - proof Looking for a mathematical proof which shows that a Strict Sense Stationary (SSS) process is necessarily a Wide Sense Stationary (WSS) process. Why did the descriptive "Orientals" shift into a pejorative? What is the proper way not to scare civilians?