My aim is to upload an image and completely replace the original source image with a , as if the custom image sized file was the uploaded image.  For example, I have custom image size wpse, and I want to replace the original image completely with this file upon upload.    How is this possible?   Potential approach could be to hook into the upload process, edit the guid key in the wp_posts table with the URL of the wpse image, then delete the source uploaded file. I'm sure there are other values which needs to be updated.
As our users regularly upload ~6MB images to use on the website (and aren't too familiar with how to resize them first), WordPress stores the originals as well as resizing them to several different sizes.  I'd like a function or plugin that takes the uploaded image, resizes it down to something more manageable and then replaces the original.  I've seen some functions that delete the original but do not replace it, meaning it is impossible to regenerate the thumbnails at a later date. I need this to be replaced so the user can upload a large image and it is automatically resized down and stored for future resizing if needed.
Can jQuery .load append instead of replace? My 3-month-old son has started sleeping through the night, with a vengeance. He sleeps for hours. And when he finally wakes up and I expect him to be starving, he's often still ready to happily play for a bit - say 1/2 hour to 45 min. Now, I know this isn't such normal behavior for a 3-month-old, and I'm definitely appreciating having my nights back, but I'm also a bit concerned - how long is the longest I should let him go without eating?  Edit (more details):  I used to try to stretch him and make his last feeding right before I went to sleep, so that I could take full advantage of his sleep-time. So we used to put him to bed about 12:30-1:00, and then head to sleep ourselves. He started off going about 6-7 hours... But a couple of weeks ago he started sleeping longer, and longer, and longer... Now he goes nearly 12 hours. He'll go to sleep at 12:30 AM and wake up at 12 PM or later. And he'll then happily play for another half hour, making about 12 hours of no-eating. I generally trust that I can rely on him to tell me when he's hungry, but I was wondering if there's a limit to how long I can let him go without eating... How to apply changes of newly added user groups without needing to reboot? Assume I'm logged in with user takpar:  takpar@skyspace:/$   As root, I've added takpar as a member of group webdev using:  # usermod -a -G webdev takpar   But it seems it has not been applied, because for example I can't get into a webdev's directory that has read permission for group:  400169 drwxr-x--- 3 webdev webdev 4.0K 2011-08-15 22:34 public_html  takpar@skyspace:/home/webdev/$ cd public_html/ bash: cd: public_html/: Permission denied   But after a reboot I have access as I expect. As this kind of group changing is in my routine, is there any way to apply changes without needing a reboot?  Answer It seems there is no way to make the current session know the new group, for example the file manager won't work with new changes. But a re-login will do the job. The su command is also appropriate for temp commands in urrent session. How to start a terminal with certain text already input on the command-line? Rather than rephrasing my question, let me describe to you the desired user-case:  I create a short shell-script to run command "gnome-terminal --someoptionflagname 'my text to be posted'", and execute this script.  Gnome-terminal pops up, with command-line prompt followed by my text.   ie: fields@mycomputer:/$ my text to be posted  Can this be done? I always stumble when using abbreviations in a sentence, as they inherently contain a period in them. How do I use a comma or a semicolon after an abbreviation? How about a period?  E.g. (This is an example of my quandary) says:     squinch (skwɪntʃ)      (US)      transitive verb         to squint (the eyes); squinched up her eyes in disgust.               2.         a. to pucker or screw up (the face, nose, brow, etc.); Jonathan squinched his face into a grimace.       b. to squeeze or compress; She squinched the paper up in an angry twist and stood to throw it into the stove ; Robert squinched the ketchup bottle, trying to get the last bit out.      intransitive verb         to squint, pucker, or contort   to crouch down or draw oneself together so as to seem smaller; ;  (Source: .)   to flinch         Word Origin: probably blend of squint and pinch      First Known Use: 1835      Example Sentences Including "squinch:"      Cooper saw her squinch up her eyes, trying to make out who was standing outside her kitchen window.      An unhappy smile is still a smile, insofar as the corners of the mouth are drawn back or upturned. However, the eyebrows may be furrowed, and the eyes may be squinched or teary. Also, the lips tend to be pressed together, rather than relaxed as in a happy smile.    My question is, how do native speakers of AmEng use the verb squinch in the senses supported above by CAED?  In addition, what's the difference between using either "squinch" or "squint/flinch" as in the following examples:     She squinched (up) her eyes, trying to make out who was standing outside.      She squinted her eyes, trying to make out who was standing outside.   -and-     The driver squinched as the sun hit his windshield.         -and-              -and-     He squinched as the cold water struck him.         -and- How to reference sections, equations, and figures in a separate document (e.g., supplemental information)? I have a main document (manuscript) and a supplemental document.   I wonder if there is a way that I can "link" the two (make them recognize each other) so that section, equation, and figure references across documents are recognized? Eclipse is not starting on Windows 7 Looking for a sci-fi movie in which a human astronaut befriends an alien on a reddish planet This probably wasn't a blockbuster back in its time as I remember the special effects didn't seem all that bombastic, but I do remember a few details.  A human astronaut lands (or crash-lands) on a prominently reddish planet. It might have been Mars, thought it might not have been. I think the atmosphere on said planet was humanly breathable (as in the astronaut does not wear his helmet).  This human astronaut needs to survive. He spots a humanoid alien, apparently also having crash-landed or otherwise in need of survival. He sees this alien consume some sort of greenish orb, apparently for nourishment. He sneaks up to the alien (or the alien craft) in an attempt to grab some of those greenish orbs. I don't remember whether he succeeds, but he does get beaten up by the alien.  The next bit of detail I remember was the human astronaut constructing some sort of shelter to protect both him and the alien from... meteor showers? The human astronaut piles up some rocks to build a hut while the alien, apparently having learned a few English words, says "shiiiiit" and "no solid". The human astronaut asks, incredulous, "No solid?" and punches the hut he just build. "See? Solid!" he proclaims, while the hut collapses a few seconds later. The alien laughs.  Later on the human astronaut is either caught by or accidentally fell into some sort of mouth-in-the-sand creature. He is saved by the alien in the process (or was it the alien who fell into the mouth-creature and was saved by the human astronaut). They witness the mouth-creature spitting out a turtle-like shell (from another local wildlife) of some sort. The human astronaut observes, and I paraphrase, "This stuff must be so tough that even [the mouth-creature] cannot digest it!" He then proceeds to build a meteor shelter from collected shells.  The last bit of detail I remember is when the alien becomes pregnant and is dying. The human astronaut, having thoroughly befriended the alien at this point, asks (and I paraphrase), "What do you mean you're pregnant? Aren't you a male?" to which the alien responds (and again I paraphrase), "For us it comes naturally, unlike for you humans whose pregnancy only comes after a brief period of pleasure". The alien then asks the human astronaut to bring the child to the alien's home planet and recite the names of the child's ancestors in front of... alien rulers, I guess. The last scene of the movie is of the human astronaut, having arrived at the alien's home planet, standing side-by-side (or perhaps hand-in-hand) with the alien child while chanting in an alien language (what I presume to be the names of the child's ancestors). Proof that the Casimir invariant of a representation commutes with everything I'm far from being a physics expert and figured this would be a good place to ask a beginner question that has been confusing me for some time.  According to Galileo, two bodies of different masses, dropped from the same height, will touch the floor at the same time in the absence of air resistance.  BUT Newton's second law states that $a = F/m$, with $a$ the acceleration of a particle, $m$ its mass and $F$ the sum of forces applied to it.  I understand that acceleration represents a variation of velocity and velocity represents a variation of position. I don't comprehend why the mass, which is seemingly affecting the acceleration, does not affect the "time of impact".  Can someone explain this to me? I feel pretty dumb right now :) I can use ls -ld */ to list all the directory entries in the current directory. Is there a similarly easy way to just list all the regular files in the current directory? I know I can use find  find . -maxdepth 1 -type f   or stat  stat -c "%F %n" * | grep "regular file" | cut -d' ' -f 3-   but these do not strike me as being overly elegant. Is there a nice short way to list only the regular files (I don't care about devices, pipes, etc.) but not the sub-directories of the current directory? Listing symbolic links as well would be a plus, but is not a necessity. Remove blank attributes from an Object in Javascript How do I remove all attributes which are undefined or null in a JavaScript object?  (Question is similar to  for Arrays) Seeking podcasts related to geospatial technologies? Integrating $\int^{\infty}_0 e^{-x^2}\,dx$ using Feynman's parametrization trick Many researchers list out their submitted manuscripts on their website. Some specify the journal name, like     Smith J, Oliver J (under review) My awesome paper. Nature.   while others don't, like     Smith J, Oliver J (under review) My awesome paper.   One reason I can think of as to why some don't mention the journal name is that they may get embarrassed in the case where the current journal rejects the paper. Then, the "circle" will know this paper gets rejected from Nature first and then ends up in an inferior journal.  Besides this, are there any other considerations preventing people from mentioning to which journal they submit a paper to?  P.S.: I am asking because my advisor is a researcher who only mentions accepted  papers on his webpage. As a student hunting jobs, I feel it is advantageous for me to mention my submitted papers on my webpage. I hesitate to do so, as I worry I may make my advisor unhappy by announcing in which journal our papers are currently under review. First, my apologies if this has already been asked/answered.  I wasn't able to find this question via search.  My question comes from Rudin's "Principles of Mathematical Analysis," or "Baby Rudin," Ch 1, Example 1.1 on p. 2.  In the second version of the proof, showing that sets A and B do not have greatest or lowest elements respectively, he presents a seemingly arbitrary assignment of a number $q$ that satisfies equations (3) and (4), plus other conditions needed to show that $q$ is the right number for the proof.  As an exercise, I tried to derive his choice of $q$ so that I may learn more about the problem.  If we write equations (3) as $q = p - (p^2 - 2)x$, we can write (4) as   $$ q^2 - 2 = (p^2 - 2)[1 - 2px + (p^2 - 2)x^2]. $$  Here, we need a rational $x &gt; 0$, chosen such that the expression in $[...]$ is positive.  Using the quadratic formula and the sign of $(p^2 - 2)$, it can be shown that we need   $$ x \in \left(0, \frac{1}{p + \sqrt{2}}\right) \mbox{ for } p \in A, $$  or, for $p \in B$, $x &lt; 1/\left(p + \sqrt{2}\right)$ or $x &gt; 1/\left(p - \sqrt{2}\right)$.  Notice that there are MANY solutions to these equations! The easiest to see, perhaps, is letting $x = 1/(p + n)$ for $n \geq 2$.  Notice that Rudin chooses $n = 2$ for his answer, but it checks out easily for other $n$.  The Question:  Why does Rudin choose $x = 1/(p + 2)$ specifically?  Is it just to make the expressions work out clearly algebraically?  Why doesn't he comment on his particular choice or the nature of the set of solutions that will work for the proof?  Is there a simpler derivation for the number $q$ that I am missing? Suppose that $A, B, C$, and $D$ are sets with the cardinalities related as  $|A|=|C|$ and $|B|=|D|$. Prove that the cardinality of $A\times B$ is equal to the cardinality of $D\times C$.  I know that I must prove the bijection of the function $f: A \times B \to C \times D$, but I am not sure how to say this? Can anyone help me? Getting a System.Type from type's partial name I want to get a System.Type given only the type name in a string.  For instance, if I have an object:  MyClass abc = new MyClass();   I can then say:  System.Type type = abc.GetType();   But what if all I have is:  string className = "MyClass"; Im trying to have the bibliography defined for my document using BibTeX and the natbib citation management package. Styles such as unsrtnat give me the references in order of appearance in text. However, I have a problem that I cannot get around. Basically if a reference is supposed to look like:     Tyson J.P. Dikstra M. Holmes F.M.R. Theoretical Analysis on Effect of   Anomalous Low Friction. International journal of Placticity,   34(3-4):413, 1997.   after typesetting it appears as :     Dikstra M. Holmes F.M.R. Tyson J.P. Theoretical Analysis on Effect of   Anomalous Low Friction. International journal of Placticity,   34(3-4):413, 1997.   In other words, it puts the first author in the last place. Is there any method of getting around this?  The entry as it appears in the .bib file (refs.bib) is:  @ARTICLE{Tyson1997, author={Tyson, J.P., Dikstra, M., Holmes, F.M.R.}, title={Theoretical Analysis on Effect of Anomalous Low Friction.}, journal={International journal of Plasticity}, year={1997}, volume={34}, number={3-4}, pages={413}, document_type={Article} }   An excerpt from the tex file:  \usepackage[round,comma]{natbib} \begin{document}  As an alternative method of analysis, \citet{Tyson1997} ...  \bibliographystyle{unsrtnat}  \bibliography{refs}  \end{document}