this is the loop im executing for(int i=0;i&lt;str.length;i++){     if (str[i]==strFind) {         str[i]=strReplace;         count++;     } }  The problem is that if the last word of the sentence has a period in some test cases and it doesn't have a period in some.And if i replace the word in the given manner. I cannot retain the period. Is there a simpler solution for this? Also, can replace all take a sting variable(strReplace-user input)?
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
Tense change: previous actions on something that's currently true How to show that $\lim_{n \to +\infty} n^{\frac{1}{n}} = 1$? I've spent the better part of this day trying to show from first principles that this sequence tends to 1. Could anyone give me an idea of how I can approach this problem?  $$ \lim_{n \to +\infty} n^{\frac{1}{n}} $$ Training involved to ride 175 miles (281 km) in a day I want to be able to ride 175 miles (281 km) in a day (to do the ). I used to be able to do about 60 miles (96.5 km), only once hitting 80 miles (128 km), but I'm out of shape now. Wondering how I can systematically train to get to 175 miles at an average of 15 mph (24 km/h) Are there guides out there to help with this?  What's some advice?  [update] The  will happen each year, so my intention isn't to ride this year, rather what do I need to do to ride it in some future year? Brownian motion - Hölder continuity Let $B$ stand for a Brownian motion on a finite interval $[0,1]$. If I am not wrong, I think that there exists a positive constant $c$, such that almost surely, for $h$ small enough , for all $0&lt; t &lt; 1- h$  \begin{align} |B(t+h)-B(t)| &lt; c\sqrt{h\log(1/h)} \end{align} or something like this. As a result   \begin{align} \bigg|\frac{B(t+h)-B(t)}{h}\bigg| &lt; K(h)  \end{align}  Am I correct ? I have 4 servers with Debian Wheezy OS. I have Apticron installed that informs me about updates. Debian updates are realized so often that when I finish to update the last of 4 servers I get new email about new updates on the first server. I try to update all servers when I get a notification but I never know if there is a need to reboot the servers. I have read that if the directory "/var/run" contains file "reboot-required" I have to reboot the server. But I never have seen this file in "/var/run". How can I know when reboot is required? I don't want reboot my servers every time when I install new updates if it's not needed.  I understand that if I update PHP or MySQL, etc I don't need to reboot the server but updates usually contain many "lib...".  Below are 9 updates (I have received this week).  krb5-locales 1.10.1+dfsg-5+deb7u3 libdbus-1-3 1.6.8-1+deb7u6 libgssapi-krb5-2 1.10.1+dfsg-5+deb7u3 libk5crypto3 1.10.1+dfsg-5+deb7u3 libkrb5-3 1.10.1+dfsg-5+deb7u3 libkrb5support0 1.10.1+dfsg-5+deb7u3 libruby1.8 1.8.7.358-7.1+deb7u2 libxml2 2.8.0+dfsg1-7+wheezy3 ruby1.8 1.8.7.358-7.1+deb7u2   I have no idea what is "libkrb,libgssapi", etc. How can I detect if reboot is needed? Please do not suggest to install UnattendedUpgrades to let the servers update automatically because this can cause websites going offline if something updates not correct. Why do I have to press Ctrl+D twice to close stdin? What is causing different spacing between a header and content on one page only? I have found that for only one page (so far) the spacing between the header and content is different from the spacing on all the other pages. You can see this behavior in the images below (from pages 2 and 3 of the document):     My .tex file contents are shown below.  \documentclass[a4paper]{report} \usepackage{fullpage} \usepackage{lipsum} \usepackage{fancyhdr} \pagestyle{fancy} \setlength{\headsep}{0.5cm}  \begin{document} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\chaptermark}[1]{\markboth{\thechapter. #1}{}} \fancyhead[L]{\bfseries \leftmark} \fancyhead[R]{\bfseries \rightmark}  \chapter{Version Control} \lipsum \lipsum \lipsum \lipsum  \end{document} Silencing "Your disk is almost full" notification Matrix Ring of a Semisimple Ring I recently read the concept of semi-simplicity of a (not necessarily commutative) ring.  A ring $R$ is said to be semi-simple if $R$ as a left module over itself is a semi-simple module (This in turn means that each submodule (i.e, left ideal) of $R$ is a direct summand for $R$.)  I am grappling with the following question:     If $R$ is semi-simple, then so is the matrix ring $M_n(R)$.   It is a theorem that each left module of a semi-simple ring is a semi-simple module. Thus $M_n(R)$ is a semi-simple module of $R$. But this doesn't help me.  I need to show that each left ideal of $M_n(R)$ is a direct summand for $M_n(R)$. Is there a characterization  of the left ideals of $M_n(R)$ in terms of the left ideals of $R$?  Lastly, does the converse also hold?     If $M_n(R)$ is a semi-simple ring, then is $R$ necessarily a semi-simple ring?   Thanks. In either case, one coin flip resulted in a head and the other resulted in a tail. Why is {H,T} a different outcome than {T,H}? Is this simply how we've defined an "outcome" in probability?   My main problem with {H,T} being a different outcome than {T,H} is that we apply binomial coefficients (i.e. we count subsets of sets) in some common probability problems. But if we take {H,T} and {T,H} to be different outcomes, then our "sets" are ordered, but sets are by definition unordered...   I feel as though the fact that I'm confused about something so basic means that I am missing something fundamental. Any help or insight whatsoever is greatly appreciated! Is it possible to mark the same tag as "Interesting" and "Ignored"? Can you mark the same tag as both interesting and ignored? If you can, what is the resulting appearance of a question with that tag? LibreOffice Calc - Disable rounding There are a  on this topic, but no simple and definitive answers.    Can someone please tell me how to permanently disable cell rounding on the .csv file which is created by script?  Basically, '377635637222436751' is being converted to '377635637222437000' automatically and that isn't really acceptable for my needs.  I've tried this: Tools->Options->Calc->Calculate "Precision as shown"   and this: Format > Cells > Numbers > Category > (scroll down for) Text. (but considering my script creates the .csv -- this option isn't very good since it must be done after the file is created)  And neither is working.  The number stays rounded -- even after formatting the column after the file is created.  Does anyone have any suggestions? I am trying to determine if the sum $\sum_{n=1}^\infty \frac{n+4^n}{n+6^n}$ is convergent or divergent.   In attempting to solve this problem I began by seeing if I could do the divergence test - in this case it is not helpful. The terms $4^n,6^n$ look like geometric series type terms but the $n$ in the numerator and denominator are troublesome. I first tried factoring $n$ out of the expression:  $$\sum_{n=1}^\infty \frac{n+4^n}{n+6^n} = \sum_{n=1}^\infty \frac{1+\frac{4^n}{n}}{1+\frac{6^n}{n}}$$  Next I tried comparing to the series $$\sum_{n=1}^\infty \frac{\frac{4^n}{n}}{\frac{6^n}{n}} = \sum_{n=1}^\infty \frac{{4^n}}{{6^n}} = \sum_{n=1}^\infty{\left(\frac{2}{3}\right)}^n$$  This is a convergent geometric series as $r = \frac{2}{3}\lt1$  now I reason that the series $\sum_{n=1}^\infty \frac{1+\frac{4^n}{n}}{1+\frac{6^n}{n}}$ is neither smaller not greater than the series $\sum_{n=1}^\infty{(\frac{2}{3})}^n$ Am I able to conclude anything in this case by a direct comparison test or can I only conclude that the first series is convergent if the second is greater than the first?  Thanks Let $a,b,n$ be integers such that  $\gcd(a,n)=\gcd(b,n)=1$. How to show that $\gcd(ab,n)=1$?   In other words, how to show that if two integers $a$ and $b$ each have no non-trivial common divisor with and integer $n$, then their product does no have a non-trivial common divisor with $n$ either.     This is a problem that is an exercise in my course.   Intuitively it seems plausible and it is easy to check in specific cases but how to  give an actual proof is not obvious. I am running Xubuntu 11.10 and everything works nicely. I have selected a nice Xfce theme and everything looks beautiful, except Libreoffice.  While other programmes (Gimp, Inkscape, Thunar etc.) integrate with the selected Appearance &amp; Window Manager theme, Libreoffice looks like a Windows 98 programme.  Does anyone know how to fix this? I have already tried this solution, without success:   Thanks for your help! Deleting 'garbage' nodes after polygon dissolve I work with QGIS 2.10.1 on Windows 7 (x64). I have dissolved polygons from an attribute value and the polygons geometries being not perfectly joined together, I get some 'garbage' nodes I need to delete. I have tried to edit the layer and using nodes tool, selecting and deleting the nodes, but it seems impossible to do (nodes are not deleted at all!). Any idea on how to process this kind of clean-up?  EDIT : you can  for testing. In my rebuilding project I have counted 18 outlets and lights on one bedroom circuit that travels through 3 rooms. Is that ok? How do I restore an accidentally deleted initrd image? Is there a way to force Google Photos to recognize new faces? Is there any way to add if elif and else in drivers?  Given the way we do if and else, here are two examples out of few other things i tried to get the statement right but unable to do so:  var-3.5 if (var&lt;0) var+3.5 elif (var&gt;0) else 1  var-3.5 if (var&lt;0) elif var+3.5 (var&gt;0) else 1   And also if there's any other way to add multiple if/else similarly?