In python, i have this dictionary :  dict = {'key1':[a,b,c] , 'key2':[1,2,3], 'key3':[a,b,c]}   I need to group the keys with the same value (lists in this case) together in order to get a new dictionary:  res = {'group1':[key1,key3], 'group2':[key2]}   How can i do this in a easy/comprehensive way?
Given a dictionary like so:  my_map = {'a': 1, 'b': 2}   How can one invert this map to get:  inv_map = {1: 'a', 2: 'b'}
How do I remap multi-key sequences to individual keys? With proper nouns, we don't use the except for river names, newspaper names, etc.  I want to know why we use the with White House. I mean, under which rule can we categorize it? What could other similar examples for that rule be? Hide a Field From ONE User Scenario: If I had a Custom Profile / Standard Profile, say Sales,and I have 50 Users assigned to the same Profile and had same Permission / Access on a particular object (Could be Standard or Custom Object), if I were to Hide a Field ONLY TO ONE USER, which would be  a better Solution to achieve this WITHOUT EDITING OR TOUCHING THE PROFILE??  Option 1: Create a Custom Profile for this particular User and give CRED access (I know this one isn't a good solution as I got a Thumbs-down from a Technical Architect)  Option 2: Create a Permission Set - Go to the particular Object,say, Accounts, Object Permission Enabled -->Field Permissions-->Remove READ Access - This would make this particular field hidden from the Object to the Profile. Then Assign this Permission to particular User whom I don't want to see this field.  I would go with the 2nd option but I still hear a groan. Where am I going wrong? How would you hide a particular field from ONE User out of 10 Profiles who have the same Access Rights?  What's the best possible solution to hide a Filed from only one User out of 10 Users who have the same Profile. Mysql resolving 127.0.0.1 to hostname Maximum Likelihood Estimate with different parameters Suppose that X and Y are independent Poisson distributed values with means $\theta$ and $2\theta$, respectively. Consider the combined estimator of $\theta$ $$ \tilde{\theta} = k_1 X + k_2 Y $$ where $k_1$ and $k_2$ are arbitrary constants.   Find the condition on $k_1$ and $k_2$ such that $\tilde{\theta}$ is an unbiased estimator of $\theta$. For $\tilde{\theta}$ unbiased, show that the variance of the estimator is minimized by taking $k_1 = 1/3$ and $k_2 = 1/3$. Given observations $x$ and $y$ find the maximum likelihood estimate of $\theta$ and hence show that $\tilde{\theta}$ is also the maximum likelihood estimator.   I have gotten (1) and (2) okay, but it's (3) I am having trouble with, I'd be okay if $X$ and $Y$ had the same parameter but I'm having trouble with $X$ and $Y$ having different parameters, any help would be appreciated.   NOTE   For (1) I got $k_1 = 1 - 2k_2$.   For (2) I found the variance of $\tilde{\theta}$, then differentiated and let equal to zero to minimize - therefore we get (after subbing in $k_2 = 1 - k_1/2 $) $$3k_1-1=0,$$ which when subbing in $1/3$, we see it is minimised.   Thank you. How to switch between virtual console and GUI in Ubuntu? I wanted to see what key functions would allow me to switch between the two. So what I have right now is something like this:  PropertyInfo[] info = obj.GetType().GetProperties(BindingFlags.Public);   where obj is some object.  The problem is some of the properties I want aren't in obj.GetType() they're in one of the base classes further up.  If I stop the debugger and look at obj, the I have to dig through a few "base" entries to see the properties I want to get at.  Is there some binding flag I can set to have it return those or do I have to recursively dig through the Type.BaseType hierarchy and do GetProperties on all of them? I understand the idea of a focal length for a single lens, i e the distance from the lens to the point at which parallel rays of light converge. However, in the case of a photographic lens with multiple lens elements, where exactly is the focal length of the lens as a whole measured from? Reference Text that develops Linear Algebra with Knowledge of Abstract Algebra Background: Due to some unfortunate sequencing, I have developed my abstract algebra skills before most of my linear algebra skills. I've worked through Topics in Algebra by Herstein and generally liked his approach to vector spaces and modules. Besides a very elementary course in linear algebra (where most of the time went towards matrix multiplication), I have not developed any other linear algebra skills.  But it seems that it is now necessary for me to do so. Most of the topics that I am looking at now require some background of linear algebra and I still lack understanding of ideas like: bilinear forms, invariant subspaces, eigenvalues, requirements for diagonalization of a matrix and so forth.  This brings me to my question (provided there are any)     Question: What are some good texts that develop the theory of linear algebra from a perspective of general algebra?   Are there any texts that develop the key (elementary) ideas of linear algebra in an abstract setting? Thank you for the help! Is spacetime flat inside a spherical shell? In a perfectly symmetrical spherical hollow shell, there is a null net gravitational force according to Newton, since in his theory the force is exactly inversely proportional to the square of the distance.  What is the result of general theory of relativity? Is the spacetime flat inside (given the fact that orbit of Mercury rotates I don't think so)? How is signal from the cavity redshifted to an observer at infinity? Is there a way to force Google Photos to recognize new faces? Monty hall problem extended. So i've been working on a Page Object Model framework for a large web application for our current company. It's the first time i've made my own framework and implemented the page object model. Im using Ruby w/Capybara and Selenium-Webdriver for my language/driver of choice.  Currently i've divided each page (or obvious "section of the site") into a class file. This class file has methods for just about everything (or an API of sorts). The problem i've ran into is that I am literally writing a method for every single thing....and i've came across 2 ways people seem to do this:  Lets pretend for a section/page of the site is a widget creation form, the widget has a name/description and some sort of "type" dropdown. Also a save button to save the widget.  Option A (Which is what i've done so far): Make a method for each element (the save button, called save_widget, all the different inputs, etc...)  Option B: Have getter and setter methods for each element, then a larger method which uses these private getter and setter methods.   With Option A my test scripts end up being longer, and honestly not much different than using selenium calls themselves.   Option B would probably call one method (Such as create_widget which would pass in multiple items which that method would call all the smaller getter/setter methods). This would make the test script MUCH shorter and more abstracted. However the getter/setter methods would probably take more actual writing for the page objects themselves (but possibly easier to maintain).  Is there a certain style that favors one over the other? The more I think about it the more Option B seems better...but I wonder if in this case abstraction is a good thing. How do I clear Bash's cache of paths to executables? When I execute a program without specifying the full path to the executable, and Bash must search the directories in $PATH to find the binary, it seems that Bash remembers the path in some sort of cache. For example, I installed a build of Subversion from source to /usr/local, then typed svnsync help at the Bash prompt. Bash located the binary /usr/local/bin/svnsync for "svnsync" and executed it. Then when I deleted the installation of Subversion in /usr/local and re-ran svnsync help, Bash responds:  bash: /usr/local/bin/svnsync: No such file or directory   But, when I start a new instance of Bash, it finds and executes /usr/bin/svnsync.  How do I clear the cache of paths to executables? Accessing System Databases/Tables using LINQ to SQL? What are the basics of commands in Minecraft Java Edition? Is there a word for someone who won't think critically? Is there a word for someone who won't think through issues and instead comes to others hoping that they will think for them and solve problems for them?  A word that is more specific to a lack of critical thinking skills than "lazy"? Why are There No "Triernions" (3-dimensional analogue of complex numbers / quaternions)? Since there are  complex numbers (2 dimensions) and quaternions (4 dimensions), it follows intuitively that there ought to be something in between for 3 dimensions ("triernions").   Yet no one uses these. Why is this? Continuing in the Visual Studio debugger after an exception occurs When I debug a C# program and I get an exception throwed (either thrown by code OR thrown by the framework), the IDE stops and get me to the corresponding line in my code.  Everything is fine for now.  I then press "F5" to continue. From this moment, it seams like I'm in an infinite loop. The IDE always get me back to the exception line. I have to Shift + F5 (stop debugging/terminate the program) to get out of his.  I talked with some co-workers here and they told me that this happens sometime to them too.  What's happening? If I have the function $f(x)$ and I want to apply it $n$ times, what is the notation to use?  For example, would $f(f(x))$ be $f_2(x)$, $f^2(x)$, or anything less cumbersome than $f(f(x))$? This is important especially since I am trying to couple this with a limit toward infinity.