I'm trying to 'ORDER BY' a String field which contains numbers. It orders like this:  1 10 2 3 ...  I've tried whith LPAD, VALUE, *1, but nothing works.  THANKS all for ur help!
I want to get records from custom object sort by a field as number. The field I want to sort is string type. Is there any way to do that? I am storing result in list, is there a way to sort list based on the string field but sort it as number?
For which $n$ does $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=\frac{1}{a+b+c}$ imply $\frac{1}{a^n}+\frac{1}{b^n}+\frac{1}{c^n}=\frac{1}{a^n+b^n+c^n}$ I'm having trouble finishing a problem on an old national competition.  As the title states, the question says asks:  Given $a,b,c \neq 0,a+b=c$ such that $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=\frac{1}{a+b+c}$,  Find all integers $n$ such that $\frac{1}{a^n}+\frac{1}{b^n}+\frac{1}{c^n}=\frac{1}{a^n+b^n+c^n}$.  I know that if it is true for $n$, it is also true for $-n$ since $(a^n+b^n+c^n)(\frac{1}{a^n+b^n+c^n})=1$ and $(a^n+b^n+c^n)(\frac{1}{a^n}+\frac{1}{b^n}+\frac{1}{c^n})=1$ and the statment follows for $-n$ given that we can make the substitution for $n$. Thus I found out that $n=-1$ satisfies the equality.  I also know that it fails for all even $n$. If $n$ were even, $(a^n,b^n,c^n)$ would all be positive, and Titu's Lemma asserts that $\frac{1}{a^n}+\frac{1}{b^n}+\frac{1}{c^n}\geq \frac{9}{a^n+b^n+c^n}$. Thus $n$ must be odd.  I also observed that $(2,-1,1)$ was a solution, and from here noted that this particular solution satisfies all odd $n$.  I have been trying to prove that all other solutions satisfy all odd $n$ with no success.  Any help would be greatly appreciated. Thanks! Find and replace text within a file using commands How can I find and replace specific words in a text file using command line? Is there any data in Tolkien (books/letters/etc..) to explain why there were precisely 9 Men rings and 7 Dwarf rings and 3 Elf rings? (the latter assumes that Sauron planned the number of Elvish rings to be 3 before he was thwarted by Elves making the rings themselves)  Was it because of the amount of tribes/kings he needed to deal with? Some magical/power limitations? Magical properties of numbers 9 and 7 (ala 7 Horcruxes)? A whim of Sauron's?    UPDATE: Looks like 3 and 7 are explained in the answers (3 elf lords and supposedly 7 Dwarf houses, though nobody provided canon proof).  What was NOT explained was why there were 9 Man rings?    If 9 was a meaningful amount, why? If it was merely "19-7-3" leftover, then why were there 19 total non-One rings made? Convergence of $\sqrt{n}x_{n}$ where $x_{n+1} = \sin(x_{n})$ Consider the sequence defined as  $x_1 = 1$  $x_{n+1} = \sin x_n$  I think I was able to show that the sequence $\sqrt{n} x_{n}$ converges to $\sqrt{3}$ by a tedious elementary method which I wasn't too happy about.  (I think I did this by showing that $\sqrt{\frac{3}{n+1}} &lt; x_{n} &lt; \sqrt{\frac{3}{n}}$, don't remember exactly)  This looks like it should be a standard problem.   Does anyone know a simple (and preferably elementary) proof for the fact that the sequence $\sqrt{n}x_{n}$ converges to $\sqrt{3}$? Penalized methods for categorical data: combining levels in a factor Is there a proof from the first principle that the Lagrangian L = T - V? Is there a word for the sadness over "What might have been"? Using MAX in SQL Expression of ArcMap ModelBuilder How to prove $B-A \succeq 0 \Leftrightarrow$ ellipsoid $x^TBx \leq 1$ contains $x^TAx \leq 1$? Assume $A \in \textbf{S}^n_{++}$, an ellipsoid centered at the origin given by $$\mathcal{E}_A = \{x\mid x^TA^{-1}x \leq 1\}$$ Then we have $\mathcal{E}_A \subseteq \mathcal{E}_B $ if and only if $B-A \succeq 0$. This is the proposition in the Boyd &amp; Vandenberghe's  (pages 45-46). The authors gave only the result, without proof. How to prove it? Local anchor for group master (move/translate/offset of group master moves group instances)? Let's say I start with the default Blender (2.64) file, except I set the cube to be 1 for all dimensions. At that point, the cube is at xyz location (0,0,0).  Then, let's say I select the cube with right mouse button, and go to Object / Group / Create New Group, and confirm the name "Group" in the "Create New Menu" bar with [Enter]. The selection outline turns green, meaning it's a group "master" (as far as I can see).  Now, let's say I press Shift-A; and choose "Group Instance" > "Group", and set the new instance to Z=2.3; with all selected, the view looks something like this:    Now, let's say I deselect all with A, then select the group master with right-click; and let's say I move it to Y=-2; then the result is:    ... that is, it is noticeable that the group instance/clone also moved in respect to its center (note the group instance axes, which remain in the set position)! Which means, I guess, that groups are defined in respect to the global coordinate center (0,0,0) as anchor.   My question is: is it possible to define a group, but in respect to the, say, bounding box center of the group as anchor - such that when I move/translate the group master, the group instances would remain anchored at their set position (basically, at the center of the group instance axes)? Also, is this documented anywhere in Blender documentation (I had problems finding this info)? How is a pitch supporting fast bowlers or spin bowlers? Including the interaction but not the main effects in a model "Me and my wife" or "my wife and me" Keep getting error 'list' object has no attribute 'split' I would like to create a String.replaceAll() method in JavaScript and I'm thinking that using a regex would be most terse way to do it.  However, I can't figure out how to pass a variable in to a regex.  I can do this already which will replace all the instances of "B" with "A".  "ABABAB".replace(/B/g, "A");   But I want to do something like this:  String.prototype.replaceAll = function(replaceThis, withThis) {     this.replace(/replaceThis/g, withThis); };   But obviously this will only replace the text "replaceThis"...so how do I pass this variable in to my regex string? Theorem environment with hanging indentation I would like to define a theorem environment with custom layout. In particular, I want the body of the theorem to be indented, like this  Text body. Text body. Text body.  Theorem 1 (Pythagoras).     Let a,b,c the sides of a rectangular triangle.     Without loss of generality, we assume that  a&lt;b&lt;c .     Then, the following equality holds:            a^2 + b^2 = c^2  More text. And even more text.   This is similar to the quote environment, I believe.  How can I do this?  Preferably, I would like to use the existing \newtheorem command, but that's not mandatory. Setting post meta data to random value during post status transition / on publish Irrationality of sum of two logarithms: $\log_2 5 +\log_3 5$ I try to prove that the number $$\log_2 5 +\log_3 5$$ is irrational. But I have no idea how to do it. Any hints are welcome. I was playing around with some integrals and noticed that some integrals of the form:  $$I(a,b,c)=\int_a^\infty \frac{\arctan(x+b)}{x^2+c}dx$$ Does have a closed form. I am trying to find for what constant $c$ will this work. In case you wonder why only $c$ is problematic, I will try to show by an example.  $$I=I(1,3,16)=\int_1^\infty \frac{\arctan(x+3)}{x^2+16}dx$$ Let's start by letting $x-1=t\,$ thus: $$I=\int_0^\infty \frac{{\arctan(\color{blue}{t+4})}}{t^2+2t+17}dt$$ With $\displaystyle{t=\frac{17}{y}\rightarrow dt=-\frac{17}{y^2}dy}$ $$I=\int_0^\infty \frac{{\arctan\left(\color{red}{\frac{17}{y}+4}\right)}}{\left(\frac{17}{y}\right)^2 +\frac{34}{y}+17 }\frac{17}{y^2}dy\overset{y=t}=\int_0^\infty \frac{{\arctan\left(\color{red}{\frac{17}{t}+4}\right)}}{t^2+2t+17}dt$$ $$2I=\int_0^\infty \frac{{\arctan(\color{blue}{t+4})+{\arctan\left(\color{red}{\frac{17}{t}+4}\right)}}}{t^2+2t+17}dt$$ $${\arctan(\color{blue}{t+4})+{\arctan\left(\color{red}{\frac{17}{t}+4}\right)}}=\arctan\left(\frac{\color{blue}{t+4}+\color{red}{\frac{17}{t}+4}}{1-(\color{blue}{t+4})\left(\color{red}{\frac{17}{t}+4}\right)}\right)$$ $$=\arctan\left(\frac{x^2+8x+17}{x}\frac{x}{-4(x^2+8x+17}\right)=\pi-\arctan\left(\frac14\right)$$ Above follows since the original integral is positive so we take $\arctan(-x)$ as $\pi-\arctan x $ and therefore getting a negative answer will not be an issue. $$I=\frac12 \left(\pi -\arctan\left(\frac14\right)\right)\int_0^\infty \frac{1}{t^2+2t+17}dt$$ Well, now the inner integral is not hard to compute and the final answer happens to be: $$I=\frac12 \left(\pi -\arctan\left(\frac14\right)\right)\frac14\arctan\left(\frac{t+1}{4}\right)\bigg|_0^\infty =\frac{\pi^2}{16}-\frac{3\pi}{16}\arctan\left(\frac14\right)+\frac18\arctan^2\left(\frac14\right) $$ There are more examples that I found by checking and try such as:  $$I(1,2,9)=\int_1^\infty \frac{\arctan(x+2)}{x^2+9}dx$$ $$I(2,1,6)=\int_2^\infty \frac{\arctan(x+1)}{x^2+6}dx$$ $$I(2,2,13)=\int_2^\infty \frac{\arctan(x+2)}{x^2+13}dx$$ And so on... All those can be solved by the same method: First substitute $x-a=t$, then let $t=\frac{\alpha}{y}$, where $\alpha$ is the "free of x" coefficient from the denominator.   The problem is that I tried more than $100$ combinations to get those integrals which is not that nice. How can we "smartly" find $c$ so that $I(a,b,c)$ is evaluable by symmetry? Or put in other word what should be $c$ if one wants to compute by symmetry $I(7,13,c)$? Why aren't Java Collections remove methods generic? Why isn't  generic?    Seems like Collection&lt;E&gt; could have boolean remove(E o);   Then, when you accidentally try to remove (for example) Set&lt;String&gt; instead of each individual String from a Collection&lt;String&gt;, it would be a compile time error instead of a debugging problem later.