I am trying to to override a binding in a child injector that was already configured in a base injector.  like that :   public class PersistenceModule extends Abstract{      @Override     protected void configure() {         bind(IProductPersistenceHelper.class).to(ProductPersistenceHelper.class);     } }   then :   Injector injector = Guice.createInjector(new PersistenceModule()); injector.createChildInjector(new AbstractModule(){         @Override         protected void configure() {             bind(IProductPersistenceHelper.class).to(MockProductPersistenceHelper.class);         }  })   Guice is complaining that it has already a binding for that. Are there any patterns or best practices for that problem ?
I've just started playing with Guice, and a use-case I can think of is that in a test I just want to override a single binding.  I think I'd like to use the rest of the production level bindings to ensure everything is setup correctly and to avoid duplication.  So imagine I have the following Module  public class ProductionModule implements Module {     public void configure(Binder binder) {         binder.bind(InterfaceA.class).to(ConcreteA.class);         binder.bind(InterfaceB.class).to(ConcreteB.class);         binder.bind(InterfaceC.class).to(ConcreteC.class);     } }   And in my test I only want to override InterfaceC, while keeping InterfaceA and InterfaceB in tact, so I'd want something like:  Module testModule = new Module() {     public void configure(Binder binder) {         binder.bind(InterfaceC.class).to(MockC.class);     } }; Guice.createInjector(new ProductionModule(), testModule);   I've also tried the following, with no luck:  Module testModule = new ProductionModule() {     public void configure(Binder binder) {         super.configure(binder);         binder.bind(InterfaceC.class).to(MockC.class);     } }; Guice.createInjector(testModule);   Does anyone know if it's possible to do what I want or am I completely barking up the wrong tree??  --- Follow up: It would seem I can achieve what I want if I make use of the @ImplementedBy tag on the interface and then just provide a binding in the test case, which works nicely when there is a 1-1 mapping between the interface and implementation.  Also, after discussing this with a colleague it would seem we'd head down the road of overriding an entire module and ensuring we have our modules defined correctly.  This seems like it might cause a problem though where a binding is misplaced in a module and needs to be moved, thus possibly breaking a load of tests as bindings may no longer be available to be overriden.
How quickly does the Ultimate Meter fill up? ASCII art generator Can someone explain me this  please I am a bit confused?  It's from a texbook I am reading (block cipher companion)  it says that:      each weak key has  $2^{32}$ fixed points $m$ where $\operatorname{DES}_w(m) = m$ ( $w$ is a DES weak key). In other words encrypting a fixed point gives exactly the same point. To see this consider the $2^{32}$ ciphertexts after 8 rounds of encryption for which the two 32 bit halves are equal. For a weak  DES key, the round keys of the eighth and ninth rounds are equal. Thus the intermediate texts after seven rounds and after nine rounds of encryption will be equal. Since the round keys of the 7th and the 10th rounds are equal, the intermediate texts after 6 rounds and after 10 rounds of encryption will be equal. Continuing like this it follows that the plaintext will be equal to the ciphertext.    Now did not quite get :   Why are there $2^{32}$ fixed points?  And why after the eighth round of encryption the two halves must be equal? What does the author mean by the intermediate texts exactly? And how are they being equal?   P.S.: This question is not asking for what the weak keys are. I am asking for "fixed points" not exactly weak keys. For this reason I think it is not a duplicate of any other question. There is one similar question to what I've asked for which I have checked and saw that no satisfactory answer has been given there either.  Here is the similar question with no proper answers: Understanding psql prompts After having read various articles on this site about WWW or Non-WWW website setup, ,  and , and after having setup a correct redirection rule in .Htaccess to at least eliminate duplicate contents (currently the non-www solution (e.g. http://example.com) I have a feeling that my site rank less since I changed this.   My confusion was strengthened by these two opponents:     &amp;     Could the change of www.example.com >> http://example.com have a factual impact on ranking?  say either is better or worse. Are they holding information back?  I am confused fellow folks...  As much as I would like to separate facts from fiction, I am aware that not all the good valid information is written. Not on google webmaster site and perhaps not elsewhere. If so it seems out of date!  Does or does not a WWW domain impact SEO/rank better than its NON-WWW version? (Given that you have setup a proper redirect to avoid duplicates and go with one) Equation's symbols or parameters description are shown below, however, the = and the details of parameter are not aligned.     I want to make a parameters list for a equation like this, in which symbols, = and detail information are aligned in terms of vertical position.  where    ...    P   =   notional permeability factor    N   =   number of waves    Sd  =   damage level    ...   A tabular environment will produce more spacing before and after text. So how to make the = vertical aligned?   The codes is provided:  \begin{equation} \frac{H_s}{\Delta D_{n50} } = 1.0~ P^{0.13}~ \left(\frac{S_d}{N} \right)^{0.2} \xi_m^P~ \sqrt{\cot \alpha} \end{equation} where:   $H_s$ = significant wave height, equal to the average of the highest 1/3 of the waves  $\Delta$  = relative buoyant density, equal to $\rho_r / \rho_w - 1$, where     $\rho_w$ is the water density  $D_{n50}$ = nominal  diameter defined in Equation (2)  $P$ = notional permeability factor  $S_d$ = damage level   $N$ = number of waves  $\xi_m$ = breaker parameter based on mean wave period $T_m$  $\alpha$ = slope angle Windows 10 language bar hot keys are reseted to (none) after locking I have 3 different keyboard layouts set up on my laptop and use Ctrl+Shift+[1-3] key combination to switch between them.  Like that:    However, after locking and unlocking Windows (with a password), these hotkeys don't work anymore and key sequence is rolled back to (None):    Signing out from Windows or rebooting the laptop sets everything back to normal, until lock/unlock again.  I think this behaviour is related to the usage of the same hotkeys in File Explorer - to switch view (Extra large icons/Large icons/Medium icons accordingly). After the lock/unlock switch view starts working again.  Seems like File Explorer overrides language bar hotkeys after the unlocking.  How can I disable this functionality? Completely disabling Ctrl+Shift+number functionality in File Explorer will do, however I can't find anywhere on the internet how to do it.  Any ideas or help appreciated! I am trying to create a 3d game in unity. I have a cube in unity and I want it to move left or right on swipe . It should move to a distance till where user swipe or take their finger off of a screen. I want it to move fast or the cube should move fast on swipe and cube should flow smooth. Like in the gif there is a circle and the user use their finger to move the circle till wherever the user swipe it and it should be instant and I want my cube to move like that at a distance till where user swipe their finger and it should be instant and fast.  I don't know how to do it. Any help is appreciated! Do you want to come with? Can I come with?  I seem to hear this construction more often in recent years, but it still grates on my ear. I know it's often said that one shouldn't , but I class that rule along with  (i.e. — pedantic tosh). Is it always informal/casual speech to end a sentence with &quot;with&quot;? Was it ever thus? Take a look at the following screenshot I took from Google Webmaster Tools "Remove URLs" page:   None of these were performed by me or others who have access to GWT.  How do these removal requests happen without us doing any requests?  Why is that happening?  How to stop that or is there any point in stopping that? How many inventions did Fred and George have? Fred and George Weasley are known for their trouble-making and general &quot;solemnly swearing they are up to no good&quot;. Their antics/adventures give something to smile about and show us not all wizards are as serious as Professor McGonagall and Hermione. This gives them a reputation of being less intelligent and indeed they only achieved three OWLs. However, we also see the twins have quite a brilliant side! Being able to open and successfully run a shop in Diagon Alley without having completed their Hogwarts education is no easy take (IMO, anyway). Their creations helped students get out of class, our heroes out of tight spot, and even stop our enemies execute an evil plot. Ginny may have said it best:  &quot;We’ve been hearing explosions out of their room for ages, but we never thought they were actually making things,&quot; said Ginny. &quot;We thought they just liked the noise.&quot; Harry Potter and the Goblet of Fire  Do we know how many things Fred and George invented? Content Assist for JSF2 + CDI (weld) beans + Eclipse Helios algebraic element over a field Let $F$ be a subfield of a field $K$, $a$ an element of $K$.  Prove that $a$ is algebraic over $F$ iff $F[a]=F(a)$.  For the first direction I've tried this: $a$ is algebraic over $F$ $\Rightarrow$ there is a polynomail $f$ over $F$ such that $f(a)=0$ $\Rightarrow$ $1,a,a^2,...,a^m$ are linearly dependent $\Rightarrow$ $\deg(F[a])&lt;m$.    but it contains $f(a)$ so they are equal..  is that correct? about the other direction.. i simply have no clue Permissible for display name to advertise another SE site? Is it permissible to use your SE display name to advertise another SE site or Area 51 Proposal? Is this scrupulous or laudable?   I don't refer to my comment box. For example, could I change 'LePressentiment' to 'Commit to Law SE' to advertise the  proposal? What does // mean in a path? I was working in my terminal, when I misspelled while cd to root (/). Accidentally, I typed // and I got in terminal:  root@weblocalhost://#   When i type pwd, i get response // but when I type ls -s i got same list as in / directory.  When you type more than 2, i.e. /// you get:  root@weblocalhost:/#   Always 1 / except for 2. Is there any difference and what is // for? JComboBox Selection Change Listener? Can HTML5 databases and localStorage be shared across subdomains? What pins on a nRF51822 do I connect to a STM32 programmer? I want to be able to program a  with  but I'm not sure what pins on the actual chip I should use, and all the guides seemed to be using a different chip markdown doesn't work properly How to convince airport security that I am not dangerous when having metallic parts in my body?