slicing multi-dimensional numpy arrays with arrays
Subsetting a 2D numpy array
Dynamically set value of a file input I am a senior undergraduate (electrical) engineering student, exceedingly interested in physics. 4 years ago when entering university, for some reasons (better: illusions) I chose engineering as my major, while I was interested (and also really knowledgeable) in physics . Soon after the first semester I realized that I've decided wrong, and I must have chosen physics.  Since our university is a technical institute and does not have a strong physics department I decided to study physics on my own, without changing my major.But I took and passed the basic graduate physics courses (advanced quantum mechanics, advanced statistical mechanics, electrodynamics I &amp; II), have done a few research projects and had a paper published (maybe 1 more in the future). I have explored lots of research areas in physics and I think I have a good potential for doing research.  While concentrating on physics, I was inattentive to EE courses. Today, while searching for graduate programs, I saw that some schools require a minimum GPA, usually 3. I just calculated my GPA and found out that it is 2.95!   Do all universities have a GPA threshold?  Since I'm changing my major and also have a good GPA in graduate physics courses, is there any way I can compensate for my (very) low electrical engineering GPA? (like by taking subject GRE, etc.) If I first (somehow) get a masters degree in physics and then apply for a PhD, can I throw away this electrical engineering GPA in my PhD application ?   Any other suggestion is warmly appreciated. Is there an official list of Disney Princesses? How can we print line numbers to the log in java How to print line numbers to the log. Say when outputting some information to the log, I also want to print the line number where that output is in the source code. As we can see in the stack trace, it displays the line number where the exception has occurred. Stack trace is available on the exception object.  Other alternative could be like manually including the line number when printing to the log. Is there any other way? Proper fstab entry to mount a samba share on boot? I am a little confused on the proper fstab entry for a samba share in Ubuntu 12.04     I can get the drive to mount manually by using:  sudo mount -t cifs //192.168.2.2/raid_drive /mnt/homeserver -o username=jon,password=password  So I tried putting this in fstab:  //192.168.2.2/raid_drive /mnt/homeserver cifs username=jon,password=password,iocharset=utf8,mode=0777,dir_mode=07‌​77 0 0  Which gives me this error in syslog:  kernel: [ 2217.925354] CIFS: Unknown mount option mode kernel: [ 2217.936345] CIFS VFS: default security mechanism requested.  The default security mechanism will be upgraded from ntlm to ntlmv2 in kernel release 3.3  This  says to use smbfs although I believe smbfs is deprecated?   What is a common fstab configuration for a samba share in Ubuntu 12.04?   EDIT:  Using the accepted answer below I was initially getting this error message (from dmesg):  [   45.520883] CIFS VFS: Error connecting to socket. Aborting operation [   45.520990] CIFS VFS: cifs_mount failed w/return code = -115   although it turns out this was due to network connectivity issues, and not related to improper fstab entry. CentOS 7 DVD ISO vs Everything ISO different How can Linux/Ubuntu be installed safely on ChromeBook? Is installing Ubuntu on my Chromebook potentially dangerous to anything on my Chromebook? I got it as a gift, so I don't want to destroy anything that is important on the laptop. Also, which is better for being able to safely install Ubuntu: ChrUbuntu or Crouton? I'm using the Samsung Chromebook 3 (as described by the quick-start manual). Does that make any other differences as well? How do I divide a circle into equal parts like a pie chart with Adobe Illustrator? Is there a fairly simple way to divide a circle into equal parts using Adobe Illustrator CC? Prove that $(p+q)^m \leq p^m+q^m$ Prove that $2^{1/2}$ is irrational I'm trying to understand each part of this completed proof that my professor did, here is my interpretation in parentheses, please advise as necessary.  Proof: Assume that $2^{1/2}$ is rational, then $2^{1/2}$ = $p/q$ for some integer $p$ and $q$ with $q \neq 0$ and $\gcd(p,q) = 1$  $$(p/q)^2 = 2 = p^2 / q^2 $$ $$\text{ (What was the purpose of squaring √2 and p/q?)}$$  $$p^2 = 2q^2$$ $$ \text{ (Is this basically just canceling out the q^2 on left side, and multiplying the right side?)}$$  2 | p^2 => (2 divides p^2 since it is a factor)  2 | p => (thus 2 divides p)  p = 2k for some integer k => (definition of even)  (2k)^2 = 4k^2 = 2q^2 => (Why are we squaring 2k, and how does 4k^2 = 2q^2?)   q^2 = 2k^2 => (Canceled out 2 on one side, and dividing on other)  2 | q^2 => (2 divides q^2)  2 | q => (thus 2 divides q)  2 | gcd(p,q) => (2 divides gcd of p and q)  2 | 1 Which is a Contradiction (no clue how I got here) Virtual Box Toolbar Hidden. How to show? Is it possible to remove "Show Desktop" from the Alt+Tab application switcher? Extension fields isomorphic to fields of matrices Suppose $K \subset L$ is a finite field extension of degree $m$. Is it true that there exists some natural $n$ such that $L$ is isomorphic to a subfield of $M^{n\times n}(K)$, the ring of $n\times n$ matrices with entries in $K$? What is the smallest dimension (as a function of $m$) for which an isomorphism exists?  The example I had in mind was the 2-dimensional extension $\mathbb{R} \subset \mathbb{C}$ with $\mathbb{C}$ being isomorphic to $\{ \begin{pmatrix}a&amp;-b\\b&amp;a\end{pmatrix} : a, b \in \mathbb{R}\}$. Print leading zeros with C++ output operator? $m$ doesn't come in the sequence $a_n=[n+\sqrt{n}+\frac{1}{2}]$ iff m is a perfect square Let $(a_n)$ be a sequence of positive integers defined by  $a_n=[n+\sqrt{n}+\frac{1}{2}]$  Show that a natural number $m$ doesn't occur in the sequence iff it is a square. I need to echo a string containing angle brackets (&lt; and >) to a file on a Windows machine.  Basically what I want to do is the following: echo some string &lt; with angle &gt; brackets &gt;&gt;myfile.txt  This doesn't work since the command interpreter gets confused with the angle brackets.  I could quote the whole string like this: echo "some string &lt; with angle &gt; brackets" &gt;&gt;myfile.txt  But then I have double quotes in my file that I don't want.    Escaping the brackets ala unix doesn't work either: echo some string \&lt; with angle \&gt; brackets &gt;&gt;myfile.txt  Ideas? I am trying to compile a list of the different ways to come up with the closed form for the sum in the title. So far I have the famous Gauss story, the argument by counting doubletons, and using generating functions. Is there any other (significantly) different way to discover the closed form?  To clarify, Gauss's method was to take $1+2+3+\dots+n$, write it backwards, and add it up. How to use grep and cut together? Lets say I'm doing a database for fruits. Using a text file for it, inside contains, in this format,  (Fruit:Quantity:Cost) Apple:10:1 Orange:20:2 Pears:10:3 Banana:20:4  10 Apples at $1 each. 20 Oranges at $2 each. 10 Pears at $3 each. 20 Bananas at $4 each.   My simple script goes like this:  echo "Enter fruit to find" read fruit  echo "Enter quantity to find" read count  echo "Enter cost to find" read cost  grep $fruit FruitDB.txt     It will display the fruits in the database.  But how do i use grep and cut together to find just by the quantity or the cost. In the quantity count area, let's say i enter 20, it will display the Oranges and Banana. Or when i enter count and cost, it will display just those that meet the conditions. Can I disown my heir? Everything was perfect. I have a good and young ruler, who has passed on some good genes to his sons. I also had a lot of spare lands, so I could make my heir a duke and doubly count when he came of age.  My mistake was to marry him off to some scheming wench. I knew it would end like this, but her stats were just too great to resist!  Anyway, a few years down the road, and my trusty spy master lets me know that my beloved son is looking to usurp me. Not cool! I demand that he end the plot, and decide to see how this develops.  Shortly thereafter, he suddenly dies (not by my hand — likely the wife is the culprit). My second eldest son becomes my new heir and favourite, however all the titles are inherited by my clubfooted grand daughter aged two. Curses!  Now, what I really wanted, was to imprison and disown my traitorous son followed by swift justice of the axe. Not sure what my other vassals would think of that idea, but I had a just reason for imprisonment at least.  Option number two, is to start plotting for my dearly beloved grand daughters untimely demise, but I'm not sure how that would work out either.  The situation is this. I'm young (40ish) and well-liked. I have a new heir, but I'd prefer to keep my lands for myself and give him the ones of the previous heir — one duchy and two counties currently held by my grand daughter. The duchy can be revoked free of charge, as I hold a claim to it. She has no siblings. I am da King. I have limited crown authority, but can bump it up to medium if it suits me.    So my questions to you are as follows:   Is it possible to disown a son, considering I have just cause for imprisonment? An execution would of course settle the deal, but my other vassals would probably find me "cruel". Is it possible to plot against a character which is not yet of age? What would happen if she suddenly died with no heir? Would all her titles be returned to the king or duke (i.e. me)?   EPILOGUE I had savegames before and after, so I decided to test a few things.   I could imprison my quisling of a son. I could also seize all his titles and banish him from my lands, but he would remain an heir, even if he wasn't officially a prince. I guess I could have let him rot in jail, as it seems prisoners often die in custody, but it would be a risky bet. After the unfortunate death of my old heir, it seems some strange rules apply regarding the remaining titles. The dukal title I could simply revoke for free (although at a opinion penalty from the duchess). Should she die today, one of the counties would be inherited by her younger sister, and the other would be inherited by me.   I found this to be an interesting development: Turns out my new heirs wife suddenly died. Who did he marry, other than the same scheming hag who presumably killed off his brother, and made an attempt at me? By a suspicious coincidence, I died not very long after. Such is the effects of the deceitful and ambitious traits combined with a really dope intrigue stat. ;) Are dual US citizens affected by President Trump's ban on Iran, Iraq, Libya, Somalia, Sudan, Syria, Yemen?