public void searchSong(String songToSearch){     Toast.makeText(getApplicationContext(), songToSearch, Toast.LENGTH_SHORT).show();     boolean found = false;     for(int i = 0; i &lt; fileArray.length; i++ ){         String value = fileArray[i].toLowerCase().replace(".mp3","");         if (songToSearch.toLowerCase().matches(value) &amp;&amp; !found) {             Toast.makeText(getApplicationContext(), value, Toast.LENGTH_SHORT).show();             found = true;         } else {             found = false;         }         if(found){             Toast.makeText(getApplicationContext(), "Found", Toast.LENGTH_SHORT).show();         }     } }   I want to use the code to check if the songToSearch is a part of any string inside the fileArray  Example lets say that fileArray[2] is equal to "Hello world" and the songToSearch is equal to "world" I would like to make the boolean found true... However this is not happening... the boolean never changes
Say I have two strings,  String s1 = "AbBaCca"; String s2 = "bac";   I want to perform a check returning that s2 is contained within s1. I can do this with:  return s1.contains(s2);   I am pretty sure that contains() is case sensitive, however I can't determine this for sure from reading the documentation. If it is then I suppose my best method would be something like:  return s1.toLowerCase().contains(s2.toLowerCase());   All this aside, is there another (possibly better) way to accomplish this without caring about case-sensitivity?
Who can use magic scrolls? I'm confused about who can use scrolls in 5e. In the DMG, p139 under Magic Item Categories: Scrolls, it states that:     Any creature that can understand a written language can read the   arcane script on a scroll and attempt to activate it.   This implies that anyone can try to cast a spell using a scroll. However, on p.200 in the Spell Scroll entry it states that:     If the spell is on your class's spell list, you can use an action to read the scroll and cast its spell without having to provide any of the spell's components. Otherwise, the scroll is unintelligible.   Then there is the bit about a DC 10 + scroll spell level ability check if the spell is higher than a spell slot that you can cast.     If the spell is on your class's spell list but of a higher level than you can normally cast, you must make an ability check using your spellcasting ability to determine whether you cast it successfully. The DC equals 10 + spell's level. On a failed check, the spell disappears from the scroll with no other effect.    So, which is it? Can anyone who can read a language use a scroll (like a fighter) if they make an arcana check, or just a PC with that specific spell in their spell list (only spell casters)? My website is javatechig.com and is around 6 months old. I have used All-in-One SEO WordPress plugin for SEO tricks. Definitely after using SEO plugin, my website page view is increased, but still it is not giving one good site-link in Google Search.   I have followed the following steps:   Created sitemap.xml and submitted to Google Webmaster Tools Edited all posts with meta tags Header tags are carefully taken care   I want to make a sitelink similar to the attached image: Why are doctors addressed as Mr. in the UK? In the US most physicians, surgeons and dentists are addressed as "doctor". Very few other professionals receive the same title.  In the UK, however, surgeons and dentists seem to prefer to be referred to as Mr. If that is true, why?  And who is addressed as Dr. in the UK?  Those who hold doctoral degrees only? How do I remove duplicates from a C# array? I have been working with a string[] array in C# that gets returned from a function call. I could possibly cast to a Generic collection, but I was wondering if there was a better way to do it, possibly by using a temp array.  What is the best way to remove duplicates from a C# array? Reinstalling Ubuntu with a dual boot I was experiencing problems with Ubuntu Desktop like missing and broken system packages, missing Unity package and other problems. So I decided that the best solution (without touching Windows files) is just to reinstall Ubuntu.  I looked everywhere and found the way but got confused as some say that I supposed to choose "Erase Ubuntu and reinstall", others say that I supposed to choose "Something else" and just select it manually while installation. I thought the first option would be better and just safer as I don’t want any of Windows files to be touched but it says that it has a bug that erases all other partitions...   Current Ubuntu version: 17.04 desktop 32bit will be replaced with 16.04.0 desktop 32bit (as 32bit 17.04 version is no longer available)   What’s the safer option to choose? And if the second one is, how to make sure it’s Ubuntu partition? Where does the curve $x^y = y^x$ intersect itself? This problem is quite easily solved by using logarithms and derivative and forming the function $f(x,y) = x^y - y^x$, however there are assertions that this problem can be solved without using either of the two. I can not see how one would proceed to solve this problem in the absence of logarithmic manipulation and differentiation. Can anyone shed some light on this? product of two uniformly continuous functions is uniformly continuous Suppose that $f$ and $g$ are uniformly continuous functions defined on $(a,b)$. Prove that $fg$ is also uniformly continuous on $(a,b)$.   My attempt: Since $f$ is uniformly continuous on $(a,b)$, for all $\epsilon&gt;0$, we have $\delta_f(\epsilon)&gt;0$ such that for all $x,y \in (a,b)$, $|x-y|&lt;\delta_f$, $|f(x)-f(y)|&lt;\epsilon$  Since $g$ is uniformly continuous on $(a,b)$, for all $\epsilon&gt;0$, we have $\delta_g(\epsilon)&gt;0$ such that for all $x,y \in (a,b)$, $|x-y|&lt;\delta_g$, $|g(x)-g(y)|&lt;\epsilon$  Notice that $$|f(x)g(x)-f(y)g(y)|=|f(x)g(x)-f(x)g(y)+f(x)g(y)-f(y)g(y)| \leq |f(x)||g(x)-g(y)| + |g(y)||f(x)-f(y)|$$  Here I don't know how to bound $|f(x)|$ and $|g(y)|$. I have proven that uniformly continuous functions preserve boundedness of an interval , i.e. $f$ is bounded on $(a,b)$. Can anyone help me? When I signed up I received a welcome message specifically indicating I should take the tour to earn my first badge:     Clicking the message takes me directly to the .  However, as   , the 'Informed' badge is not active here on meta.  Shouldn't the wording of the welcome message be altered if a user signs up on a site which does not use this badge? Context Around this Code: I am making a schedulable class run each Sunday to track a couple of metrics important to the team.   Question: I am looking to consolidate DML operations and a big part of this is understanding pass by reference vs pass by value.  I want to pass the salesOps user object to the method SDREfficiencyLastWeek. I made the return type void, because I figured that I will be passing this by reference and I can make all the updates in the method without having to anything.   Why I am confused:    I read the above article and am thrown off by the following statement:  "Non-primitive data type arguments, such as sObjects, are also passed into methods by value. "   If the object is indeed passed by reference, then the query for the salesOps user in my code should be sufficient enough to edit all fields on that object without actually having to state each field in the query.  global class SDREfficientMetricsSchedulable implements Schedulable  {     global void execute(SchedulableContext sc)      {         User salesOps = [SELECT ID FROM USER WHERE id = '0056A000002Z3p9QAC'];         List&lt;String&gt; queries = new List&lt;String&gt;();          String contactsWorked_lastWeek  = 'select count(id) results from contact where LastActivityDate = last_week';         queries.add(contactsWorked_lastWeek);          String demosSet_lastWeek            = 'select count(id) results from form__c where CreatedDate = last_week';         queries.add(demosSet_lastWeek);          String demosCompleted_lastWeek  = 'select count(id) results from opportunity where (stagename = \'Unqualified Demo Completed\'  OR stagename = \'Qualified Demo Completed\' )  and RecordTypeId = \'0126A000000yudDQAQ\' and CloseDate = last_week';         queries.add(demosCompleted_lastWeek);          String qualifiedDemos_lastWeek  = 'select count(id) results  from opportunity where RecordTypeId = \'0126A0000004Ao6QAE\' and isclosed = false and  SDR_Owner__c != null and CreatedDate = last_week';         queries.add(qualifiedDemos_lastWeek);          String closedWon_lastWeek       = 'select count(id) results  from opportunity where RecordTypeId = \'0126A0000004Ao6QAE\' and iswon = true and  SDR_Owner__c != null and CloseDate = last_week';         queries.add(qualifiedDemos_lastWeek);            SDREfficiencyLastWeek(queries, salesOps);          update salesOps;     }       public void SDREfficiencyLastWeek(List&lt;String&gt; queries, User salesOps )     {        }  } I was watching , and it got me thinking about when optional parameters are available in C# what is going to be the recommended way to declare methods that do not need all parameters specified?  For example something like the FileStream class has about fifteen different constructors which can be divided into logical 'families' e.g. the ones below from a string, the ones from an IntPtr and the ones from a SafeFileHandle.  FileStream(string,FileMode); FileStream(string,FileMode,FileAccess); FileStream(string,FileMode,FileAccess,FileShare); FileStream(string,FileMode,FileAccess,FileShare,int); FileStream(string,FileMode,FileAccess,FileShare,int,bool);   It seems to me that this type of pattern could be simplified by having three constructors instead, and using optional parameters for the ones that can be defaulted, which would make the different families of constructors more distinct [note: I know this change will not be made in the BCL, I'm talking hypothetically for this type of situation].  What do you think? From C# 4.0 will it make more sense to make closely related groups of constructors and methods a single method with optional parameters, or is there a good reason to stick with the traditional many-overload mechanism? Error message in my excel formula How do I sort a std::vector by the values of a different std::vector? Stopping a Thread in Java? I'm in the process of writing a piece of code that connects to a server spawns a bunch of threads using that connection and does a bunch of "stuff".  There are certain instances where the connection fails and I need to stop everything and start from scratch with a new object.  I wanted to clean up after the object but calling thread.stop on the threads, but this method is seemingly deprecated.  What is the recommended alternative to doing this? Should I write my own cleanup and exit method for each of the threads? Set the thread to null? or something else? Is there really a way to make a true toon shader material in Cycles? Setting page numbering on Word I have a word document. The first four pages are title and index. After that, the “Chapter 1” starts. I want page numbers to begin from the “Chapter 1” onwards only. The first 4 pages should not have any page number.  How do I achieve this? Unzip a file with php Asymptotic expansion for Fresnel Integrals If you take the fresnel integrals to be $$S(x) = \int_{0}^{x}\sin \left(\frac { \pi \cdot  t^2}{2} \right) dt$$ How do you find the asymptotic expansion? I know it begins with a $1/2$ but how? Does the given matrix have a square root? Given the following matrix, I was asked to tell whether the matrix is the square of some matrix or not.  $$ \begin{pmatrix} 1 &amp; 0 &amp; 0\\ 0 &amp; -1 &amp; 0\\ 0 &amp; 0 &amp; -1 \end{pmatrix} $$  Since this matrix is diagonal, a square root is  $$ \begin{pmatrix} 1 &amp; 0 &amp; 0\\ 0 &amp; i &amp; 0\\ 0 &amp; 0 &amp; i \end{pmatrix} $$ Am I right? Question about Angle-Preserving Operators This an exercise out of Spivak's "Calculus on Manifolds".  Edit:  There was a typo in the exercise as is noted below in the answers.  The statement has been edited to reflect this.  Given $x,y\in\mathbb{R}^{n}$, the angle between $x$ and $y$ is defined by  $$\angle(x,y) = \arccos\left(\frac{\langle x,y \rangle}{|x|\cdot |y|}\right),$$ where $\langle x,y \rangle$ denotes the standard Euclidean inner product.  A linear operator $T:\mathbb{R}^{n}\to\mathbb{R}^{n}$ is said to be angle-preserving if $\angle(T(x),T(y)) = \angle(x,y)$ for every $x,y\in\mathbb{R}^{n}$.  The exercise as stated:  Let $\{x_{1},\dots, x_{n}\}$ be a basis for $\mathbb{R}^{n}$.  Then suppose that $\lambda_{1}, \dots, \lambda_{n}\in \mathbb{R}$ are such that $Tx_{j} = \lambda_{j}x_{j}$ for each $j = 1,\dots, n$.  Then $T$ is angle-preserving only if (not if and only if!)$|\lambda_{i}| = |\lambda_{j}|$ for every $1\leq i\leq j\leq n$.  I'm having problems with the $(\Rightarrow)$ direction.  My best attempt (which seems to lead nowhere) is to suppose that $|\lambda_{j}|\neq |\lambda_{k}|$.  Then by assumption, \begin{align*} \angle(Tx_{j},Tx_{k}) &amp; = \arccos\left(\frac{\langle Tx_{j},Tx_{k} \rangle}{|Tx_{j}|\cdot |Tx_{k}|}\right)\\ &amp; = \arccos\left(\frac{\langle \lambda_{j}{x_{j}},\lambda_{k}{x_{k}} \rangle}{|\lambda_{j}{x_{j}}|\cdot |\lambda_{k}{x_{k}}|}\right)\\ &amp; = \arccos\left(\frac{\lambda_{j}\lambda_{k}\langle {x_{j}},{x_{k}} \rangle}{|\lambda_{j}|\cdot|\lambda_{k}|\cdot|{x_{j}}|\cdot |{x_{k}}|}\right)\\ &amp; = \arccos\left(\text{sign}(\lambda_{j})\text{sign}(\lambda_{k})\frac{\langle {x_{j}},{x_{k}} \rangle }{|{x_{j}}|\cdot |{x_{k}}|}\right)\\ \end{align*} may also be calculated as \begin{align*} \angle(Tx_{j},Tx_{k}) &amp; =  \angle(x_{j},x_{k})\\ &amp; = \arccos\left(\frac{\langle x_{j},x_{k} \rangle}{|x_{j}|\cdot |x_{k}|}\right). \end{align*}  Then since $\arccos$ is injective, I believe I can make the jump that $\text{sign}(\lambda_{j})\text{sign}(\lambda_{k}) = 1$, which does not resemble the conclusion that I should arrive at.  Note:  I wasn't sure what tag to put this under, so anyone who knows better please feel free to adjust.  Thanks for any help you can give. Quotient groups of D10 How do I find the groups D10/N where N is the normal subgroups to D10?  I know that the definition is aN for all a $\in$ D10. But I am unsure what the group, for example, D10/ D10 looks like? Any help would be much appreciated.