I am trying to figure out the best way to do multiple LIKE matches in a complicated soql statement.   I want to change the hubFilter value from just "BCS%" to "BCS%,Benefit Advisor,Mgr of Ben,BSR".  I tried this and got nothing back so I assume it's not reading those as separate values. Any ideas?  Here is a basic example of what my query looks like:  list&lt;BCS__c&gt;hubs = new list&lt;BCS__c&gt;(); private string hubfilter; if(showAll == TRUE){     hubFilter = '%'; }else{     hubFilter = 'BCS%'; } hubs = [     SELECT /*fields and subqueries*/ FROM BCS__c     WHERE /*other clauses*/ AND Title__c LIKE :hubFilter ];
Is there a way to mix LIKE operator with IN ? Something Like  SELECT Id FROM Account WHERE Name LIKE IN:nameList   Where nameList is list of String? Is this is possible ? (I can make a dynamic query by doing OR with all the elements, but was looking for a more elegant way to do this)
How to permanently set environmental variables My variables are   LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib ORACLE_HOME=/usr/lib/oracle/11.2/client64   How to save these variables permanently ? Using getopts to process long and short command line options So, if we have a large pipe which is constricted in the middle, the fluid in the middle section  will move faster. Why is it so? What dictates that liquid that an X amount of it must pass on the other side regardless of the size of the encasement?  The only reason I could think about is because that the initial pressure which causes the movement somehow is being transferred to a smaller area, but that makes no sense. Stack exchange badges It might be useful to encourage existing users of stackoverflow to cross pollinate other stack exchange sites.  While rep-sharing is not useful, as rep is meant to be a measure of expertise in one subject, badges may be one way to encourage participation across many sites.  This was triggered by seeing how few people actually had greater than 1k rep on all three main sites (SO, SF, SU) via Dennis Williamson's  app.  I had tried to do this by hand prior to the API under the assumption that many people would be answering questions on all three sites, but it turns out there are only 33 people, of all the users of stackoverflow, that have a 1k+ reputation on all three sites.  Over time it may be useful to provide badges that appear on all sites one is participating in that are awarded for extraordinary participation in the whole universe of Stack Exchange sites.  For instance, a silver badge might appear on all my profiles if I obtain 1k rep on 5 or more sites, and a gold badge if I have more than 3k rep on 5 or more sites.  I would hesitate extending this much past 5 sites as we don't want to encourage spamming questions and answers on sites where the user has little interest, but across the universe of stackapps I know I'm proficient or expert in at least 10 current sites, and while it's not a big nudge, the idea that I can get extra awards - especially ones that appear on all sites I'm in - would move me to participate a little more on sites that I am registered on, but don't visit regularly.    I expect, eventually as sites are launched, most users of any one site will have some interest or knowledge in at least 5 other sites.  This may provide the extra nudge some sites need to maintain an excellent rating in terms of usage. Preserving signatures of decorated functions Suppose I have written a decorator that does something very generic. For example, it might convert all arguments to a specific type, perform logging, implement memoization, etc.  Here is an example:  def args_as_ints(f):     def g(*args, **kwargs):         args = [int(x) for x in args]         kwargs = dict((k, int(v)) for k, v in kwargs.items())         return f(*args, **kwargs)     return g  @args_as_ints def funny_function(x, y, z=3):     """Computes x*y + 2*z"""     return x*y + 2*z  &gt;&gt;&gt; funny_function("3", 4.0, z="5") 22   Everything well so far. There is one problem, however. The decorated function does not retain the documentation of the original function:  &gt;&gt;&gt; help(funny_function) Help on function g in module __main__:  g(*args, **kwargs)   Fortunately, there is a workaround:  def args_as_ints(f):     def g(*args, **kwargs):         args = [int(x) for x in args]         kwargs = dict((k, int(v)) for k, v in kwargs.items())         return f(*args, **kwargs)     g.__name__ = f.__name__     g.__doc__ = f.__doc__     return g  @args_as_ints def funny_function(x, y, z=3):     """Computes x*y + 2*z"""     return x*y + 2*z   This time, the function name and documentation are correct:  &gt;&gt;&gt; help(funny_function) Help on function funny_function in module __main__:  funny_function(*args, **kwargs)     Computes x*y + 2*z   But there is still a problem: the function signature is wrong. The information "*args, **kwargs" is next to useless.  What to do? I can think of two simple but flawed workarounds:  1 -- Include the correct signature in the docstring:  def funny_function(x, y, z=3):     """funny_function(x, y, z=3) -- computes x*y + 2*z"""     return x*y + 2*z   This is bad because of the duplication. The signature will still not be shown properly in automatically generated documentation. It's easy to update the function and forget about changing the docstring, or to make a typo. [And yes, I'm aware of the fact that the docstring already duplicates the function body. Please ignore this; funny_function is just a random example.]  2 -- Not use a decorator, or use a special-purpose decorator for every specific signature:  def funny_functions_decorator(f):     def g(x, y, z=3):         return f(int(x), int(y), z=int(z))     g.__name__ = f.__name__     g.__doc__ = f.__doc__     return g   This works fine for a set of functions that have identical signature, but it's useless in general. As I said in the beginning, I want to be able to use decorators entirely generically.  I'm looking for a solution that is fully general, and automatic.  So the question is: is there a way to edit the decorated function signature after it has been created?  Otherwise, can I write a decorator that extracts the function signature and uses that information instead of "*kwargs, **kwargs" when constructing the decorated function? How do I extract that information? How should I construct the decorated function -- with exec?  Any other approaches? Both the Romulans and the Federation have regularly violated the Treaty when it suits them. Starfleet has obviously developed and manufactured cloaking/stealth technology and the Romulans make regular excursions across the Neutral Zone. They obviously aren't declaring all-out war, so what penalties or sanctions have been imposed for violations?  -edit added for clarity-  Has either side ever 'punished' their own people for any violations of the Treaty? Calculate the Factor Group $(\mathbb{Z}_4 \times \mathbb{Z}_6)/\langle(0,2)\rangle$ Remove subscribers from Auto Suppression List How to install League of Legends in Ubuntu Can anyone can suggest where I can freely download ArcObjects SDKs for ArcGIS?  I am using version 10.2. Is it possible to install Ubuntu FROM a smartphone? So, I'm in a situation were I want to install ubuntu in my laptop (currently running windows 8) but I don't happen to have pendrives, CDs or the like available. The only "external" device I have with me is a samsung galaxy s2 with a micro SD-card in it.   Is it possible to use the phone as a pendrive to install ubuntu from it somehow? (without damaging the phone's OS and data) I want to prove the assertion:      The unique quadratic subfield of $\mathbb{Q}(\zeta_p)$ is $\mathbb{Q}(\sqrt{p})$ when $p \equiv 1 \pmod{4}$, respectively $\mathbb{Q}(\sqrt{-p})$ when $p \equiv 3 \pmod{4}$.   My first attempt is this. In $\mathbb{Z}[\zeta_p]$, $1-\zeta_p$ is prime and $$ p = \epsilon^{-1} (1-\zeta_p)^{p-1} $$ where $\epsilon$ is a unit.  Since $p$ is an odd prime, $(p-1)/2$ is an integer and  $$ \sqrt{\epsilon p } = (1-\zeta_p)^{(p-1)/2} $$ makes sense and belongs to $\mathbb{Z}[\zeta_p]$.    How do I deal with the $\epsilon$ under the square root?  I guess the condition on the congruence class of $p$ comes from that.  Is this even the right way to proceed?  Uniqueness is not clear to me either.  I thought about looking at the valuation $v_p$ on $\mathbb{Q}$, extending it to two possible quadratic extensions beneath $\mathbb{Q}(\zeta_p)$, then seeing how those have to extend to common valuations on $\mathbb{Q}(\zeta_p)$, but I didn't see how to make it work.  I would appreciate some help. Use of comma separating two adjectives If I had the phrase       two blond haired, blue eyed people    would the comma be out of place?    should I hyphenate "blond haired" and "blue eyed"? SQL MAX of multiple columns? How do you return 1 value per row of the max of several columns:  TableName  [Number, Date1, Date2, Date3, Cost]   I need to return something like this:  [Number, Most_Recent_Date, Cost]   Query? How would you evaluate $\liminf\limits_{n\to\infty} \ n \,|\mathopen{}\sin n|$ How would you evaluate the limit inferior of the sequence $n\,|\mathopen{}\sin n|$? That is, $$\liminf\limits_{n\to\infty} \ n \,|\mathopen{}\sin n|$$    Edit. Let $\mu$ be the irrationality measure of $\pi$. Since $\mu$ is not known, I will split the question:   Assuming $\mu &gt; 2$, what is $\liminf\limits_{n\to\infty} \ n\,|\mathopen{}\sin n|$? Assuming $\mu = 2$, what is $\liminf\limits_{n\to\infty} \ n\,|\mathopen{}\sin n|$?     I kind of like its graph... The recent question  made me realize that I don't have any understanding of why one would upload to a preprint site.  (I don't work in a field where they seem to be common.)  Why would one be concerned about getting a manuscript on arXiv, if it's already under review with a journal?   Is it because of the long publishing timeline of journals?  (That could explain why computer science &mdash; which publishes much more in conferences &mdash; doesn't seem to do much with them.) Round double to 3 points decimal 16.04 Upgrade: Failed to fetch Empty files can't be valid archives How to prove Fibonacci sequence with matrices? How do I allow HTTPS for Apache on localhost?