Delete single Char in String java
How do I compare strings in Java?
Is it possible to write a template that changes behavior depending on if a certain member function is defined on a class?  Here's a simple example of what I would want to write:  template&lt;class T&gt; std::string optionalToString(T* obj) {     if (FUNCTION_EXISTS(T-&gt;toString))         return obj-&gt;toString();     else         return "toString not defined"; }   So, if class T has toString() defined, then it uses it; otherwise, it doesn't. The magical part that I don't know how to do is the "FUNCTION_EXISTS" part. Sort and display directory list alphabetically using opendir() in php This is tricky. I would like to install Ubuntu on a machine that is intended to work as server, and for some reason I do not have an option to connect a screen to it.  I expect this may be similar to remote installation. However, there is currently no OS on that machine, so I will have to set up everything from scratch.  On the other hand, I do have a physical access to that machine. Therefore I can get it to boot from a CD/USB. But that's not enough.  Is there a way to do such installation remotely? Is there a version of Ubuntu image that comes with a SSH server preinstalled, and starts it once booted, so that I can boot the machine with such image, connect to it via SSH and process the installation from a different computer?  If not, what other options do I have? How do I reset the Windows XP Administrator password? PHP generate file for download then redirect What are the scope restrictions for setting shopt extglob. and other options? My non-interactive bash shell has extglob off. I would like to turn it on in the statement immediately before a command, but I have noticed that when shopt -s extglob is within an if .. then .. else block, it somehow does not register.   The following extglob-dependant command is not valid: syntax error near unexpected token '('.     Where can extglob be set, and why is there a restriction, at all? Does this apply to other options?  ... GNU bash 4.1.5     This works:    shopt -s extglob if true ;then     touch a.bcd; ls a.@(bcd) fi   This fails:    if true ;then     shopt -s extglob     touch a.bcd; ls a.@(bcd) fi ... line 17: syntax error near unexpected token `(' ... line 17: `touch a.bcd; ls a.@(bcd)' Algebraic Proof that $\sum\limits_{i=0}^n \binom{n}{i}=2^n$ I mean, why is $F=ma$? Why not $m^{0.123}$, $a^{1.43}$ or some random non-integers or irrational?  I hope you understand that my question isn't limited just to force, energy, velocity, etc.; it also extends to the area of a square, circle, etc. and all other formulas.  I think the whole thing starts with direct proportionality.  Most of them tell about the area of a circle, $A = πr^2$, where π is 3.14159..... an irrational number! It's not about the constant. I am talking about the power of a physical quantity.  I know why it has pi. It's because we chose the constant for area square to be one. If we chose it to be 1 for the circle then the area of a square will have a constant, 1/pi.   I've edited the question to 'rational exponents' since all are giving me examples of decimal non-integers. What if table columns cannot fit on webpage? If I've 12 - 14 columns in a table to show on a page but there's not enough space to show all columns (let's say, there's only enough space to show 7 columns of the table), what is the solution for this?  I can make the page scroll horizontally but it's ugly and the last resort. Shrinking the font size of the table data only has rooms for 1  - 2 more columns at best. Quickest way to rename files, without retyping directory path Emacs text-scale-adjust causes line numbers column to incrementally shrink and disappear I've set up emacs to display line numbers (global-linum-mode 1), and it works until I start enlarging the text via text-scale-adjust    The line numbers column starts to shrink, and disappears entirely after a few increments. When it has fully disappeared, further increments have no more effect on the left edge.    Is this a know issue? Is there a workaround?    Using GNU Emacs 23.1.1 in Ubuntu 10.04. Lead in ice block This is a strange question I would like to have some explanation accompanied with:  We have an ice block, with in it a lead block. This entire block is put into a glass of water, resulting in a rise of water level until the edge of the glass. The block stays floating on the surface. What will happen with the water level when the ice melts?  The answer is that it will drop, but how is this even true?? My thoughts are: - block floats on water, so rho(block) &lt; rho(water) - Archimedes law, the Fg of block = Fg of water pushed away. - Since a smaller volume of water has equal mass (and so Fg) to block, and ice is less dense than water, when it melts, no mass is lost, so it will take in less space??? Please help me with this point of thinking. Redirecting stdout to a file you don't have write permission on Open a direct file on the hard drive from Firefox (file:///) I have a small PHP system I created for myself. This system contains a few .doc and .docx file documents. I want to be able to open them directly from the browser without downloading them.  I created a link: &lt;a href="file:///c:/mysite/myfile.docx"&gt;myfile&lt;/a&gt;. But Firefox does not open the link. href="http://localhost/myfile.docx" works fine - it offers me to download the file.  Any ideas on how I can do it? Do I need to change something in the Firefox options or security settings? "I saw him crossing" vs. "I saw him cross" I saw him crossing the road.   I saw him cross the road.   Which one is correct and why? Sequence of sets $f_n$ that converge almost everywhere to $f$ but not almost uniformly to $f$? What should a rational person accept as a miracle? How can you prove that the square root of two is irrational? SEVERE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: In a ring $(A,+, \cdot)$ if $aba = a$ then $bab = b$ and all non zero elements in $A$ are invertible. Let $\left(A,+, \cdot\right)$ be a ring with $1$  that satisfies the following condition:  For any nonzero $a\in A$, there exists a unique $b\in A$ such that $aba = a$.  Show that $b$ also satisfies $bab = b$, and that all nonzero elements of $A$ are invertible.