Is there a simple way (instead of traversing manually all the string, or loop for indexOf) in order to find how many times, a character appears in a string?  Say we have "abdsd3$asda$asasdd$sadas" and we want that $ appears 3 times.
I have the string   a.b.c.d   I want to count the occurrences of '.' in an idiomatic way, preferably a one-liner.  (Previously I had expressed this constraint as "without a loop", in case you're wondering why everyone's trying to answer without using a loop).
How can I increment a date by one day in Java? I'm working with a date in this format: yyyy-mm-dd.  How can I increment this date by one day? I have two tables, movies and categories, and I get an ordered list by categoryID first and then by Name.  The movie table has three columns ID, Name and CategoryID. The category table has two columns ID and Name.  I tried something like the following, but it didn't work.  var movies = _db.Movies.OrderBy( m =&gt; { m.CategoryID, m.Name }) How do I post code in chat? I would like to be able to post code in chat. I know that I can post inline snippets of code by using backticks, but I don't know how to post blocks of code, with the entire chat message formatted as code, and indentation respected. I am aware of . After reading the comments, I found out that I could format in "fixed width", but I can't see a "fixed width" button anywhere. What should I do? Setting Objects to Null/Nothing after use in .NET Slave duplicate counter Is it possible to create a counter that is a "slave" to another (master) counter, but also an exact duplicate?  The \@addtoreset{&lt;slave&gt;}{&lt;master&gt;} resets &lt;slave&gt; whenever &lt;master&gt; is incremented (similar functionality is offered by ), but I don't know about anything incrementing one counter (&lt;slave&gt;) automatically whenever another counter (&lt;master&gt;) is incremented.  The idea is to have a macro (say) \dupcntr{&lt;slave&gt;}{&lt;master&gt;} as an analogue to \@addtoreset. The application for this might be where one is interested in renaming a counter used/provided by a package into something more meaningful for the user (say, &lt;slave&gt;), without having to reference &lt;master&gt;. Or, if the original counter contains @ that needs to be escaped every time it's used, it is sometimes more convenient to have a "more user friendly" counter.  I know one way around is to use a macro that returns the value of &lt;master&gt;, but is it possible to perform the same manipulation with a macro than one could with the counter? Manipulation here refers to the printing of the counter (via \the&lt;slave&gt;) and perhaps it's representation (like \arabic, \alph, ...). Ctrl -C, Ctrl -V not working in different keyboard layout When I am in English, Ctrl+C, Ctrl+V works fine when I need to copy paste. But when I turn to Greek, Ctrl+C and Ctrl+V and basically no shortcut almost works in Greek.  So each time I have to alt shift and go back to English in order to user Ctrl+C to copy something. How can I apply this to the Greek keyboard profile?  EDIT  I also realized that when using NetBeans IDE 7.4,  I can copy and paste in Greek but I can't use the tonic system of the language over the words. In Aptana studio I can't use Copy and paste Ctrl+C, Ctrl+V When using gedit everything works fine. Different software use different keyboard layout settings? What would be your preferred way to concatenate strings from a sequence such that between every two consecutive pairs a comma is added. That is, how do you map, for instance, ['a', 'b', 'c'] to 'a,b,c'? (The cases ['s'] and [] should be mapped to 's' and '', respectively.)  I usually end up using something like ''.join(map(lambda x: x+',',l))[:-1], but also feeling somewhat unsatisfied. How to search the internet for terms with special characters As I learnt from this , Google has no ability to search for special characters. Let's say I want to search for ss!. Are there any other search engines that can achieve this? Please do not propose any programming code search engines since this is a general search. Behavior of $\sum a_n x^n$ given $\sum |a_n - a_{n-1}| < \infty$ Let $(a_n)_{n=0}^{\infty}$  be a sequence of real numbers satisfying $\sum_{1}^{\infty} |a_n - a_{n-1}| &lt; \infty$   Which of the following conclusions must then be true?  The series $\sum a_nx^n$ converges   Nowhere on $ \mathbb{R}$ Everywhere on $  \mathbb{R}$ On some interval containing $(-1,1)$ Only on $(-1,1)$   What I have tried is Make an inequality with $|a -b| \leq |a| +|b|$ .. but i cant proceed further .. Any sort of help will be deeply appreciable . Force pagebreak after every sentence/paragraph Is there a way to force a pagebreak after every sentence or paragraph?  This may seem like an odd thing to do, but for catching typos and just general editing I find it much easier to look at a sentence or paragraph in isolation so that I am not tempted to skip ahead.  Currently, I just zoom in so I can only see a few word at a time, but this is not a perfect solution. I want to change my computer's password. Right now my password is abc123. I run this command:  sudo passwd   I entered my current password and then a new one but the change does not take effect. How can I resolve this problem ? How to hide a folder in sdcard in android I know there is a ton of questions and answers about this topic, but none answers my question sufficiently.  Let's say I have a viewport view that I want to render in Cycles. Pressing ALT CTRL Numpad 0 aligns the camera to this view, but it does not solve the whole problem. The thing is, I want PRECISELY this view on the render, preferably in one click, without manually moving the camera back-and-forth, changing sensor sizes etc. fiddling that will remove the unwanted border that appears and blocks the viewport partially. This whole activity wastes a lot of precious time especially if you do this 10 times a day.  What this dream action should do:   match the render resolution (proportions) to the resolution of the current view (can the resolution of current view be read by a Python script?) make the entire view the camera view, without any borders, passe-partout etc. by automatically maneuvering sensor sizes etc. whatever is necessary to make it exactly the same view, the same camera lens angle.   Is it possible to write such a script that would do it all in one click? Introductory measure theory textbook I would like to teach myself measure theory and I am looking for a good introductory textbook at the advanced undergraduate or early graduate level. A reader-friendly text with plenty of examples would be ideal. Check if a services is installed using C Getting a closed form from $\sum_{i=1}^{n-1} \sum_{j=i+1}^{n} \sum_{k=1}^{j} 1$ I am running Ubuntu 14.04.2 and I want to format my disk for another operating system (Windows 10).  My desire to do this stems from a recent problem I have been having with installing the new OS. I try to boot from a live DVD (which I have confirmed is working), but my computer does enter the Windows 10 installation setup.  So, I am hoping that completely wiping the disk will solve this issue. Ideally, I want to do this with my only resources being Ubuntu and an internet connection. I can't connect the hard drive to another computer, and it would be difficult for me to have to burn a disc for any reason.  Thank you. Proof for triangle inequality for vectors Generally,the length of the sum of two vectors is not equal to the sum of their lengths. To see this consider the vectors $u$ and $v$ as shown below.  By considering $u$ and $v$ as two sides of a triangle, we can see that the lengths of the third side is $\| u + v \|$ and we have $\| u + v \| \leq \|u\| + \|v\|$.  Under what circumstance equality occurs and how can one prove that? Where can I find sugar cane? I played several hours a started three different worlds in Minecraft, but I have never found any sugar canes. I read on Minecraft wiki to search near water but still no luck. Do you have more hints? Is it possible to re-create an environment that allow sugar canes to naturally grow? Read fixed width record from text file