Given a consumer which uses a service, how can this consumer select a specific provider dynamically using declarative service ?  Example  Service.java  public interface Service {     public void do(); }   Provider1.java  public class Provider1 implements Service {         @Override     public void do(){         //a way      }    }   Provider2.java  public class Provider2 implements Service {         @Override     public void do(){         //another way      }    }   Consumer.java  public class Consumer {     private Service myService;      protected void bindService(Service s){ // Actually it's Provider1         myService = s;     }      protected void unbindService(Service s){         myService = null;     }      public void useThisKindOfService(String s){         // Do something crazy     } }   So, what I would like it's instead of "Do something crazy", to find a way to reconfigure the consumer in order to release Provider1 and ask for Provider2.  Is it possible ?   Update related to "Duplicate Question"    In my context I cannot use the declarative target because the value of the target has to be know at build time, in my case the target could be defined by a user at runtime.
I am using Apache Felix and its Declarative Services (SCR) to wire the service dependencies between bundles.  For example, if I need access to a java.util.Dictionary I can say the following to have SCR provide one:  /** * @scr.reference name=properties interface=java.util.Dictionary */  protected void bindProperties(Dictionary d) { }  protected void unbindProperties(Dictionary d) { }   Now, I have more than one Dictionary service available, and I want to filter them using the "name" service property (I only want "name=myDictionary"). I can do that with code (using a ServiceTracker), but I'd rather specify the filter in the @scr annotation instead.
Solve the recurrence $T(n) = 2T(n-1) + n$ More than one private key for RSA In an RSA-encryption scenario, Bob's public key pair $(n, e)$ is $(143, 43)$. An attacker Mallory tries brute-force and comes to $d = 7$ as the private key. The value of $φ(143) = 120$ is not known to Mallory. However from $43 \cdot d \equiv 1 \bmod 120)$, one can calculate the first positive element $d = 67$ from multiplicative group $d = 120 + 67n$ and $n \in \mathbb{Z}$ $d = 7$ clearly doesn't fit in that multiplicative group, so how come it can successfully decrypt the encryption? One might expect the sum of the tracert latencies to equal 267ms: Reading through my textbook I came across the following problem and I am looking for some help solving it.  Prove that,  $$\binom{3n}{r}=\binom{3n-1}{r} + \binom{3n-1}{r-1}$$  In a previous problem I solved the following but I wasn't sure how to use it to prove the question above. Prove,  $$\binom{n}{r}=\binom{n}{n-r}$$  Solution:  left Side,  $$\binom{n}{r}=\frac{n!}{(n-r)!r!}$$  right side,  $$\binom{n}{n-r}=\frac{n!}{(n-(n-r))!(n-r)!} = \frac{n!}{(n-r)!r!}$$  Therefore completing the proof,  but how do I solve my first question? thanks! Why {are you / you are} making noise? I always get confused between these two sentences:     Why are you making noise?      Why you are making noise?   Could anyone put light in the differences between the two? Why the Principle of Least Action? Does it feel lately like all questions have already been asked and answered and there is nothing more to do? I think everybody with a history of participation can't help but notice the explosive growth of repeated duplicate questions. The work of looking for duplicates and then closing questions has overtaken the work of actually answering questions.  It's become virtually impossible to ask something which hasn't been yet asked. Lately I feel boredom each time I see a new question and start answering it only to realize after the first written sentence that I have answered similar questions five times over or seen them answered some ten times or more. I know where it's going to be going and what answers with what votes it is going to receive before any answer is even written.  It's obviously not the administration's fault, it is simply so. The questions is, what to do about it? Engaging more moderators to close and close duplicates won't work because it's already starting to repel users who get mad at their questions closed and become afraid of asking more or perhaps just go away.  The original idea of Jeff stated the the site is for questions that can be answered. Meaning no open-ended discussions. When I first read this I had a casual thought - well, and what's gonna happen when they all are asked and answered? Will it become a museum, a monument of wisdom and knowledge or what?  I'm not sure what to do about it. Perhaps deprecation/versioning of older questions so that their new versions can sparkle the tiresome evening...  POSTSCRIPTUM.  I recall Star Trek Voyager episode  when another Q asked Captain Janeway for asylum. He was tired of immortality and wanted to die. They opened a hearing and went on to visit the continuum to evaluate the living conditions there which caused the suffering and the wish to escape it in death. A lifeless picture presented itself to the visitors... a house lone in an open space, two people going about their business, nobody talking. When asked why they were silent, the following was said. It's been so long, all has already been said, all stories told, all jokes are made... there is nothing left to do...  Are we there as well?  UPDATE: Just saw this answer in another question:       Also, some of the core questions got asked early on in the life of the site. Great questions still come around from time to time, but many have already been asked.   Doesn't that confirm my point? The question asks it all really. When referring to a master's degree, do you use an apostrophe or not? That is, is it "a master's" or "a masters"? Why is the last digit of $n^5$ equal to the last digit of $n$? What are tag synonyms and merged tags? How do they work? What are tag synonyms? How can tag synonyms be distinguished from "real" tags? How are new tag synonyms created? Who can create tag synonyms? How can I delete/reverse/undo bad tag synonyms? What are merged tags? When using the serial console of my system I always end up with $COLUMNS=80 and $LINES=24.  While I can change these variables manually it is somewhat annoying to do this any time when the client side terminal window has been resized.  Usually I'm connecting to the console using screen /dev/mytty baudrate.  Changing the $TERM environment variable to "screen" or "xterm" does not help.  Will I need to call getty with some of those instead of vt100?  Needless to say that all of this works fine, when I connect to the same machine using ssh. Is gnu coreutils sort broken? I need an adjustment layer which will invert in the same way as when you select some text in a text layer I am interested in theoretical and practical considerations. How to run Wireshark on Ubuntu 17.10 I used to run wireshark on ubuntu 17.04 with  ~/$ sudo wireshark   but now (just after update to 17.10) when I write the same I get an error  ~/$ sudo wireshark      QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'     Invalid MIT-MAGIC-COOKIE-1 keyQXcbConnection: Could not connect to display :0 Keyboard layout indicator sometimes disappears Ubuntu 18.04.1 after some update In my past experiences, I have almost never typeset my manuscripts according to the formats required by the journals to which I would like to submit. I leave my manuscripts as produced by the LaTeX article documentclass.  Recently I am wondering: Would such a behavior generally give handling editors a negative first impression? How are local variables referenced in closures? Is it legal/well-defined C++ to call a non-static method that doesn't access members through a null pointer? "Insufficient storage" when trying to install new app