Error : mysql_fetch_assoc ( Table Field Name )
mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc... expects parameter 1 to be resource
Allow moderators to see delete/undelete activity on users' profiles We get auto flags for 'possible vandalism' related to deletes, and these can be helpful at times in finding 'rage quit' users, or other potential problems.  But often, I would like to know if there is a prior pattern with the user doing this. While we can see posts of theirs which have been flagged, and perhaps find previous auto flags this way, it would be nice to see an overall view of their self-deletions and undeletions; mostly just to identify patterns.  Such a feature would be nice if it was activity centered, rather than post-centered. That is; each delete/undelete action should be shown. So we could easily see, for example, if someone went back-and-forth on a single post.  The "activity" tab in the profile would be a logical place to show these events.  I think this would be best to be limited to instant self-deletions, not deletion votes. Regular Expression to match valid dates I'm trying to write a regular expression that validates a date.  The regex needs to match the following   M/D/YYYY MM/DD/YYYY Single digit months can start with a leading zero (eg: 03/12/2008) Single digit days can start with a leading zero (eg: 3/02/2008) CANNOT include February 30 or February 31 (eg: 2/31/2008)   So far I have   ^(([1-9]|1[012])[-/.]([1-9]|[12][0-9]|3[01])[-/.](19|20)\d\d)|((1[012]|0[1-9])(3[01]|2\d|1\d|0[1-9])(19|20)\d\d)|((1[012]|0[1-9])[-/.](3[01]|2\d|1\d|0[1-9])[-/.](19|20)\d\d)$   This matches properly EXCEPT it still includes 2/30/2008 &amp; 2/31/2008.  Does anyone have a better suggestion?  Edit: I found  on RegExLib  ^((((0[13578])|([13578])|(1[02]))[\/](([1-9])|([0-2][0-9])|(3[01])))|(((0[469])|([469])|(11))[\/](([1-9])|([0-2][0-9])|(30)))|((2|02)[\/](([1-9])|([0-2][0-9]))))[\/]\d{4}$|^\d{4}$   It matches all valid months that follow the MM/DD/YYYY format.  Thanks everyone for the help. 8.4 - Use entity browser in a module block from in same way as I would in a custom block Is it possible to run commands from spotlight? I run commands in terminal a lot and i'm wondering if it is possible to run the commands from spotlight. For example in spotlight  would like to run the command(because i have a lot of network issues):   ping google.com   And then spotlight to load terminal and execute the command instead of having to load terminal because it takes so long to load. So is this possible? Encrypting a key with the same key, for instance using AES I am new to crypto and trying to understand if it would be insecure to use a cipher such as AES to encrypt a key with the same key. If it is insecure, then why would it be insecure?  Basically, something like this:  encrypt(key, key)   What happens when both key and message are the same (128 bits)?  The obvious question would be why would I want to do that. If I have a secure channel to send the key, why encrypt it? My question is more for understanding. Add a property to a JavaScript object using a variable as the name? I'm pulling items out of the DOM with jQuery and want to set a property on an object using the id of the DOM element.   Example  const obj = {}  jQuery(itemsFromDom).each(function() {   const element = jQuery(this)   const name = element.attr('id')   const value = element.attr('value')    // Here is the problem   obj.name = value })   If itemsFromDom includes an element with an id of "myId", I want obj to have a property named "myId". The above gives me name.  How do I name a property of an object using a variable using JavaScript? How do I log in if my OpenID is not available, or maybe even no longer exists? Can I restore my lost account, or do I need to start over?  See also: Poisson / exponential distribution Next weekend you will be participating in 12km cross country race on a mountain.The average time between  two successive wild animal sightings on the mountain is reported to be 5 minutes  (a) What is the probability that you see at least one wild animal in the 11th minute of the     race given that you will see 3 wild animals since the start of the race?  (b) What is the probability that it will take more than a quarter of a hour before you see a wild animal after ten minutes of running?  Now I have attempted (a) , but I don't know whether my thinking is correct. (b) on the other hand makes little sense to me.  My attempt:  (a)$ X~ Poisson(\frac{1}{5})$ and $Y~Exponential(\frac{1}{5})$  $Pr(X&gt;4) = Pr(X&gt;1)$  (I am thinking that this is some variation of the memoryless property)  $Pr(X&gt;1) =Pr(Y&lt;1)$  $Pr(Y&lt;1)= 1 - (e^{(\frac{-1}{5})})$  Perhaps, I was a bit to vague in my attempt of (a). So here goes my attempt of(b).From my understanding of the question , it is asking what it the probability that the time between events(in this case animal sightings) is more than 25 minutes given you have been running for ten minutes  Now from what I know the fact that you have been running ten minutes is irrelevant this is due to memory-less property of the exponential  distribution   so without further ado  I present my attempt at (b)   let $X $ be exponentially distributed random variable with $\lambda = 1/5$  then  $Pr(X &gt;15) = 1 - Pr(X &lt;= 15)$ Speed of light in a gravitational field? How do I solve the speed of light in gravitational field?  Should I just add gravitational acceleration in speed of light?  $$c'=c_0+g(r)t~?$$ Java. Splitting a multiple word string into two word strings every space Show that, if $a$ and $h$ are positive numbers, $h &lt; a^2$, then $$\sqrt{a^2 + h}-a &lt; \frac{h}{2a} &lt; a - \sqrt{a^2 - h}$$  I've been working on this problem for about 2 hours now, but I've made no progress. I'm not looking for an answer, but I just need some help to get me started since we didn't practice inequalities this complex in highschool. Thanks.   All I can tell is that we're supposed to take the square root of an expression at some point since one inequality ( h &lt; a^2 ) becomes two.   Edit : Thank you guys for the replies, but I'd appreciate only hints in the future (like Robert Israel) so that I can learn. Regardless, I found a different way to do it, so it's cool :) If every real-valued continuous function is bounded on $X$ (metric space), then $X$ is compact. Is it possible to use an Ubuntu Live CD and run GParted to partition a my HDD (including the partition that is usually mounted on a given system)? I'm encountering a problem with my HDD's partitions and can't resize it. I've described my problem and my system here: .  Now, from a more general perspective, I was thinking on whether it is possible to use an Ubuntu Live CD and use GParted in a live session to possibly go around that problem. Is that possible? I made a separate question as I'm interested in the possibility independently from my current problem.  You see, I only have one partition and that's mounted. When I use GParted through Ubuntu I don't get any error reports (unlike the case reported in the question linked above).  Thanks beforehand. I zoomed in / out of one of my UI panels and I can't figure out how to zoom back out/ in to get it normal size.   How can I reset the zoom level of UI panels? Orthonormal basis with specific norm I need to show that $v_1,...,v_n$ is basis for $V$ whenever $e_1,...,e_n$ is an orthonormal basis for V and $v_1,...,v_n$ are vectors in $V$ such that $$\left\Vert e_i-v_i\right\Vert &lt; \frac{1}{\sqrt{n}}.$$ I know already that I only need to prove that they are lineary independent. Also I tried to prove it by contradiction, but I got stuck fairly fast. Any help, or hint how to prove it (with ot without contradiction) will be appriciated. Bravo for allowing comment editing, but what's the explanation for enforcing a five-minute window?  I think this might be over-engineering. If I have a spelling mistake or an inaccuracy I'd like to fix, I don't think the fact that five minutes has elapsed should prevent me from fixing it.  Further, if you are worried people will edit their comments in a way that makes the comment thread nonsensical, they can already do this by deleting their comment. So, limiting the ability to edit isn't really helping much in that regard.  Update  If people don't like this idea, I'm definitely open to hearing your reasons. For now, it seems like an unnecessary limitation of a quite awesome feature.  Update 2  Regarding John's scenario...     Me: Obama is cool!   You: You are right, man!      My edit: Obama is an idiot!   You: You are right, man!   ...this problem can still occur with deletions...     user1: Obama is cool!   user2: No, McCain is cool!   you: You are right, man!        user1: Obama is cool!   ---- deleted -----   you: You are right, man!     So, yes, editing could be abused as you suggest, but discontinuities can occur already because of deletions (and as someone else mentioned, because upvoted comments get prioritized upward).  As for Jeff's argument about rate limiting, I agree that is important, but I don't understand why you can't just use a CAPTCHA to prevent too many edits in a short period of time. I have named him/he who shall not be named. Which of these is correct? I think it should be "him" because "him" is a direct object in this context. In this context, "him/he who shall not be named" is not a proper noun. How can I change the default "ens33" network device to old "eth0" on Fedora 19? Sole survivor of attack on mining vessel, abandoned by his employer, has ability to teleport There's a story my grandpa use to tell me when I was younger, about the sole survivor of of an attack on a mining vessel in space. The man lives in space for months/years, ignored by the company he worked for and never rescued. Then when he thinks he is being rescued, it's actually another set of raiders who attack him and kidnap him.  He then wakes up in captivity in some sort of prison inside of an asteroid, and has a word tattooed on his forehead. My grandpa called him Ronin (that's what the tattoo on his forehead said) but I don't know what the character's real name is. Anyways, he learns that he has the ability to teleport after having a brush with death and decides to make his way back to Earth so that he can exact revenge on the mining company who abandoned him and left him floating to die.  Does anyone know what this story or book may be? My grandpa told it to me when I was little, he said that he got it from a book he use to love reading when he was younger. I'm assuming the book is very old (possibly pre 1940's as he was born in the 20s). I can't ask him as he is no longer alive. I'm also unsure as to whether or not all the details in the story he told me, are the same as in the original. Aliens want to destroy all dogs because they are seen as next step in evolution beyond Man I read a SF short story years ago, I think it may have been in high school back in the 1970s. Aliens come to earth, to kill all the dogs, because they see Man as destroying himself, and dogs as evolving to take Man's place, thus being a threat to the aliens. Humanity agrees to kill all the dogs to get rid of the aliens, but in fact have taken border collies (?) deep underground in order to save them and ensure that they evolve.  Does anyone know the title/author of this short story?  Thank you in advance for your assistance.