insert text in a file using echo command
Redirecting stdout to a file you don't have write permission on
Sorting an Array of Objects in PHP In a Specific Order I have two arrays in PHP. The first array ($author_array) is comprised of user_ids in a particular order, like so: (8, 1, 6)  The second array ($user_results) is comprised of an array of objects like so:  Array (     [0] =&gt; stdClass Object         (             [ID] =&gt; 1             [user_login] =&gt; user1         )     [1] =&gt; stdClass Object         (             [ID] =&gt; 6             [user_login] =&gt; user6         )     [2] =&gt; stdClass Object         (             [ID] =&gt; 8             [user_login] =&gt; user8         ) )   I'd like to "sort" the second array so it's in this order, which matches the order of the values in the first array of (8, 1, 6). So it'd look like this:  Array (     [0] =&gt; stdClass Object         (             [ID] =&gt; 8             [user_login] =&gt; user8         )     [1] =&gt; stdClass Object         (             [ID] =&gt; 1             [user_login] =&gt; user1         )     [2] =&gt; stdClass Object         (             [ID] =&gt; 6             [user_login] =&gt; user6         ) )   I'm weak on data structures. How could I do this? :-)  Thanks in advance for your help!  -Bob When Jedi lose parts of their body, does their midi-chlorian count and strength in the Force diminish? From what I understand, midi-chlorian count is a strong indicator of ability in the Force (though there are other factors as well). So it seems like when Anakin loses his arm or Luke loses his hand, their midi-chlorian counts (and thus their Force ability) should slightly diminish.  Is this the case? In bash, read after a pipe is not setting values What does active mean? Why does a 12V 2A adapter measure only 0.358A on a multimeter? I assume that the multimeter should read 2A, why is it only 0.358A? If this is how it is supposed to be, why? If I add a load, how do I measure that this load is being drawn, does the multimeter need to be in series? A word for 'independent episodes' When we have a series of episodes where every single episode depends on and develops from the previous, we may call that a sequel, or maybe a continuum.  Now let us say that we have a collection of fables, episodes or anecdotes that have the same characters, the same milieu, and the same themes; yet, this time, the episodes are NOT interdependent. They don't depend on each other in that you can watch/read 'any' one of them be it (in terms of order) from a beginning, medial, or final season, without having to watch/read the previous to understand, appreciate, and enjoy it (the one you're watching/reading). What do we call the 'episode' in this case?   Examples: a sitcom comedy show, or a show like Dr Who. Or, in literature, the novels of Sherlock Holmes.       Is there a specific term to describe the 'independent episodes' of these works? Is the product of two Gaussian random variables also a Gaussian? Say I have $X \sim \mathcal N(a, b)$ and $Y\sim \mathcal N(c, d)$.  Is $XY$ also normally distributed?  Is the answer any different if we know that $X$ and $Y$ are independent? How does order-preserving encryption work? Order-preserving encryption (OPE) is, apparently, a method of encrypting data so that it's possible to make efficient inequality comparisons on the encrypted items without decrypting them.  I've been coming across this term in various places (including ) lately, but I have no idea how such encryption schemes are supposed to work.  Any obvious methods I can think of to allow such comparisons on encrypted data would result in catastrophic security failure.  Certainly, I assume that OPE must involve some kind of security tradeoff compared to traditional encryption, but given that it seems to be actively  and , it seems that it must be possible to implement in a way that retains at least some level of useful security.  I just don't see how.  Given that  didn't turn up any convenient Wikipedia articles or other popular summaries of OPE, I figured I'd try asking for one here before diving into the academic literature.  (At worst, I may try to answer my own question later, if nobody else beats me to it.)  So, to summarize, my question is: How does order-preserving encryption work, and what security properties does it provide? How do i make my ubuntu server public? I want to know how to make my ubuntu server ip public. I'm not asking for a domain, if people would be able to access my website by ip, it would be great! (just for now) Does someone have an idea how to do this? I was going through some articles about "African American Vernacular English". . . These articles give some examples, but they do not clearly specify hard rules to be followed in AAVE.  First of all, I don't even have strong skills in Standard English, so understanding AAVE seems a lot more difficult for me. I did, however, craft a few sentences in both SE and AAVE to validate what understanding I do have. Are the following conversions correct? You don't have to validate each and every item, but rather guide me with rules that I should follow, but didn't, in the following examples.   What the hell are you all doing here?  —  What the hell y'all doin' here? Hey you! What the hell are you doing man? Stop that nonsense now. Do you get it?  — Hey you! What the hell ya doin’ man? Stop that nonsense now. D'ya get it? Come on, can't you open your mouths?   — Come on, ya can't open your mouths??  Hey, who's out there?  —  Hey, who out there? I know, you're listening to us   — I know, ya listenin’ to us Somebody is out there man. — Somebody out there man. Wow, it's delicious.  — Wow, it delicious. Holy crap, who're these people? — Holy crap, who these people? How can Obito use his Mangekyo so often? Java: creating a date object from a string and inserting into MySQL Finding value of $S-T$ in $2$ binomial sum. If $\displaystyle S=\sum^{n}_{k=0}(-1)^k\frac{1}{k+m+1}\binom{n}{k}$ and f $\displaystyle T=\sum^{m}_{k=0}(-1)^k\frac{1}{k+n+1}\binom{m}{k}$.Then $S-T$ is   Try:$$S=\sum^{n}_{k=0}(-1)^k\int^{1}_{0}x^{k+n}\binom{n}{k}dx=\int^{1}_{0}x^n\sum^{n}_{k=0}(-x)^k\binom{n}{k}dx$$  Could some help me, thanks Custom Tools not Saving in Toolbar on Startup/ Normal.mxt? How can I figure out why my washing machine is tripping the GFCI receptacle? I have a Kenmore 80 Series (Model No. 110.24872300) washing machine which up to this point has been working fine. Since it is near a sink, the outlet it is plugged into is a GFCI outlet. On the last load I came back after letting it run for some time to find that it had tripped the GFCI in the middle of the wash cycle - the washer was still full of soapy water. I reset the outlet and let it run again, only to come down the next morning and find it full of water still (it had tripped during the rinse cycle this time). I reset the outlet again and this time it finished the rest of the cycle.  My guess is that water is somehow getting onto the internal components of the washer and causing it to short - is there any way I can test this theory or fix the problem myself? Predicting count data with random forest? Failed a Reopen Question audit — sure looks like "Not a real question" to me I just failed , which was shown as being closed as "Not a real question".  Seeing as the vote count was positive, I figured it was an audit, but I selected "Leave Closed" anyways because to me     It's difficult to tell what is being asked here.  This question is ambiguous, vague...   There's no code examples, and the phrasing is clunky at best.  This is my second failed audit in two days for difficult questions (first failed audit is , also now closed), so if I get temporarily suspended, it won't be the end of the world (I'll think of it as a forced vacation).    That said, is there a way to dispute these audits?  Or is posting the audit here sufficient? Expansion of $(1+px+qx^2)^8\equiv 1+8x+52x^2+kx^3$... $(1+px+qx^2)^8 \equiv  1+8x+52x^2+kx^3...$  Given that expression, calculate the values of p, q, and k.  I'm guessing this is a trinomial that needs to be turned into a binomial, but how would you do it? I have no idea. I'm calling a function in Python which I know may stall and force me to restart the script.   How do I call the function or what do I wrap it in so that if it takes longer than 5 seconds the script cancels it and does something else? Prove there exists $a\in \Bbb{R}$ such that $f'(a)=0$. Let $f$ be differentiable on $\Bbb{R}$ and let $\lim_\limits{x\to \infty}f(x)=\lim_\limits{x\to -\infty}f(x)=0$. Prove there exists $a\in \Bbb{R}$ such that $f'(a)=0$.  Attempt: If $f$ is constant we are done. Otherwise, $f$ is not constant. Suppose there is no such $a$. Then, in particular, $f$ has no extremum $\implies$ $f$ has no point where is goes from increasing to decreasing or from decreasing to increasing. $f$ is continuous since it is differentiable. Hence, since $\lim_\limits{x\to \infty}f(x)=\lim_\limits{x\to -\infty}f(x)=0$, $f$ must be constant. A contradiction. Therefore either $f$ is constant and $f'(x)=0$ everywhere, or $f$ has an extremum at $x=a$ and $f'(a)=0$.   I feel like my attempt is not formal enough, any correction?  I would appreciate your help.