Java: Having trouble moving on with code after accepting user input
How do I compare strings in Java?
How can I get the node id the comment is attached to in hook_comment_insert?  I tried the following code:  function mymodule_comment_insert(Drupal\Core\Entity\EntityInterface $entity) {   if ($entity-&gt;bundle() == 'comment_custom' &amp;&amp; $entity-&gt;get('entity_type')-&gt;value == 'node') {      // Below returns empty, because "$entity-&gt;get('entity_id')-&gt;value" is empty.     $node = Node::load($entity-&gt;get('entity_id')-&gt;value);      // No luck with this one too.     $node = \Drupal::routeMatch()-&gt;getParameter('node');    } } Distribution of $Z_n=n \log\left(\frac{\max\left(X_{(n)},Y_{(n)}\right)}{\min\left(X_{(n)},Y_{(n)}\right)}\right)$ The random variables $X_1,X_2,...X_n,Y_1,Y_2,...Y_n $ are independent and $U(0,a)$-distributed. Determine the distribution of $$Z_n=n\cdot \log\left(\frac{\max\left(X_{(n)},Y_{(n)}\right)}{\min\left(X_{(n)},Y_{(n)}\right)}\right)$$ where $X_{(n)},Y_{(n)}$ denotes $n$th order variable.  This problem is giving me a headache. The answer is that $Z_n$ is $\text{Exp}(1)$-distributed. But i can't derive that conclusion. I'd like to show you my derivation, but its so long and contains so many integrals and fractions that it would take a while to write it here. But basically my approach was to derive the distribution of $M=\max(X_{(n)},Y_{(n)})$ and $L=\min(X_{(n)},Y_{(n)})$. I get the following cdf's: $F_M=(F_X\cdot F_Y)^n=(F_X)^{2n}$ and $F_L=1-(1-(F_X)^n)\cdot (1-(F_Y)^n)=1-(1-(F_X)^n)^2$ ,  correct? $F_X $ stands for the cdf of $X_i$  Then i define the random variable $T=\frac{M}{L}$ and compute its cdf to finally be able to derive the distribution of $Z_n=n\cdot \log(T)$. But thats where i think everything goes wrong. Any help appreciated, thanks. $A^TA+I$ is always invertible? Add manually installed application to 'Show Applications' grid in Ubuntu 18.04 In java SSL over https without certificate How to fix lsregister failing associations after reboot? Question, is it ok for one of the pages levels to 404? (SEO-wise)  Let's say I have a sitemap like this:  example.com --/services   --/foo   --/bar --/sectors   --/my-sector   --/another-sector   --/the-sector   --/stuff --/about-example --/contact --/etc --/etc   This makes a lot of structural sense. However, from a design point of view, I think having a page to show all the sectors (example.com/sectors) is pointless since all of the sector pages can be accessed from the home page, main navigation, and in each sector page.  Would there be any SEO consequences if the /sectors page were to 404?  Note: in the sitemap 'example.com/sectors' would not be included. How many combinations of groups are there where no member of a group has been with another member before? I found this hard to word in the title, so let me give an example. I have 16 students, and I want to split them up into 4 groups of 4. However, I want to make sure that every time I have a new combination of groups, that a student has never been with any of their new groupmates before. I found info on how to separate objects into groups, but not in only unique ways as I've described above. I think I figured this out the rote way, by assigning each student a number and then finding the unique combinations, and got 3. But I'd like to know the math behind it, and how it could be applied to other configurations (20 students w/ 4 groups of 5?). Thanks for any help you can give! How to find an unknown Steam User I was playing with someone on Ark: Survival recently, I CTD'd and couldn't get his information. Are there any means that I could find this user's Steam account even though he hasn't logged in since?  I know of the function View: Players in Steam, but it only shows me the last 24 hours and I haven't played with this player in 3-4 days. Is there a way I could extend the view recent players function on Steam? Is there a record of this somewhere? Or do I have any further options? How can I stop being prompted to unlock the 'default' keyring on boot? How can I discover any USB storage devices and/or CD/DVD writers available at a given time (using C# .Net2.0).  I would like to present users with a choice of devices onto which a file can be stored for physically removal - i.e. not the hard drive. Creating Two Executable Jars Using maven-assembly-plugin I want to show that $$\log N&lt;\sum_{n=1}^{N}\frac{1}{n}&lt;1+\log N.$$ But I don't know how to show this. Change section command in article In the document class article how do I change the command \section to behave exactly like the command \chapter in the document class book? i.e. write Chapter # and then the title and also leave some empty space at the top of the page.  Sorry if my question is not clearly stated and if this question might already exist but I couldn't find anything. Now that I've reached 2k on Stack Overflow, I get access to the "Suggested Edits" review queue.  Although I only have 20 edits per day, the "suggested edit awaiting" icon in the top bar is always there and it bothers me a lot!  My suggestion is to apply one of three solutions:   Remove the suggested edits icon when we reach the maximum (50) edits Remove the Highlight (orange) on the suggested edits Remove the suggested edits part when we click on it   What do you think? How do you debug PHP scripts? How do you debug PHP scripts?  I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful.  What is the best (in terms of fast and easy) way to debug in phpStorm or any other IDE? This is my first time through playing Elder Scrolls and initially I grabbed every quest that has come available...  At first I thought I wanted to be part of the Imperial Legion but I feel like I picked the wrong side and am now regretting my choice.  So...is there any way to un-join the Legion and join up with the Stormcloaks, or will I have to wait and join them next time? Why is part of my model not being rendered? Why is the selected object displaying in the 3D view, but not rendering?  In object mode, it shows up:   However, it does not show up in render mode:   Why is this so and what causes it to hide in render mode? How to read and write into file using JavaScript? I'd like to work on a bbcode filter for a php website. (I'm using cakephp, it would be a bbcode helper) I have some requirement.    Bbcodes can be nested. So something like that is valid.  [block]       [block]       [/block]       [block]           [block]           [/block]       [/block]   [/block]     Bbcodes can have 0 or more parameters.     Exemple:     [video: url="url", width="500", height="500"]Title[/video]   Bbcodes might have mutliple behaviours.     Let say, [url]text[/url] would be transformed to [url:url="text"]text[/url] or the video bbcode would be able to choose between youtube, dailymotion....  I think it cover most of my needs. I alreay done something with regex. But my biggest problem was to match parameters. In fact, I got nested bbcode to work and bbcode with 0 parameters. But when I added a regex match for parameters it didn't match nested bbcode correctly.   "\[($tag)(=.*)\"\](.*)\[\/\1\]"  // It wasn't .* but the non-gready matcher  I don't have the complete regex with me right now, But I had something that looked like that(above).  So is there a way to match bbcode efficiently with regex or something else.  The only thing I can think of is to use the visitor pattern and to split my text with each possible tags this way, I can have a bit more of control over my text parsing and I could probably validate my document so if the input text doesn't have valid bbcode. I could Notify the user with a error before saving anything.  I would use sablecc to create my text parser.   Any better idea? or anything that could lead to a efficient flexible bbcode parser?  Thank you and sorry for my bad english...