If "they" were our descendants who transcended to the 5th dimension, "they" are practically a Godlike civilization compared to us, then why did they developed this complicated plan rather than simply communicating with NASA and send the equations to save the earth? I mean, Cooper nearly died on several occasions, and if these guys are our descendants, they were practically playing roulette with their own survival.

I recently watched Interstellar and it was quite an amazing movie. There is something that has been bothering me. At the end, when Cooper is stuck in the time-space shelf created by the other beings (themselves/humans), he communicates with himself and Murph and he himself is the one to call himself in the space and save the earth by communicating the code back to his daughter.  My question is: If the future humans knew about the solution to the problem, why did they or Cooper chose himself to go through all the trouble to go through the space and then communicate with his daughter. Why couldn't they have done it themselves and sent the solution back to Murph themselves from the future.   Let me put it this way: "When Cooper saw himself from the shelf, why did he send himself the co-ordinates again. Why not just give Murph the solution only" Instead of sending himself the co-ordinates, couldn't he just have given Murph the solution. If the people of the future knew the solution (that they knew because that is how they survived) couldn't Cooper have just sent it to Murph from the future instead of going through the loop in space again?


Our house wiring is AC. I thought that AC means we have current flowing from Wire 1 to Wire 2, after 1s/Frequency it flips and current flows from wire 2 to wire 1 and this goes on and on. I heard something like "Neutral has a 0V potential and only live varies between 240V and -240V" But if that's true shouldn't we have current flowing from neutral to live every 1/30 of a second?

Current flows through a conductor connecting points at different potentials.  Leaving aside multi-phase details, common/conventional AC systems use a 3-wire setup:   Wire-1: a line/live/hot/phase wire presenting a point that oscillates between 2 potentials. Wire-2: a neutral wire presenting a point of unknown/unspecified and varying potential, that nevertheless presents some fixed/specified potential difference to Wire-1 at least some of the time. Wire-3: a ground/earth wire presenting a point at 0V potential difference to its immediate physical surroundings.   Wire-1 and Wire-2, in addition to some device that is to be powered, are used to construct a closed electrical circuit. Wire-3, leaving aside EMI/shielding concerns, is used to ensure that current will flow through it, rather than the device's user, if there ever occur any faults and the device's user comes in contact with Wire-1 or Wire-2.  Additionally to this however, Wire-2 and Wire-3 are at some point connected. This is done to ensure that Wire-2's potential remains close to that of Wire-3 .. which seems to be important for some reason.  Now the part I don't understand is why there needs to be a distinction between Wire-2 and Wire-3 at the power socket, if there is none a few meters further down the line.  I have tried to look this up, but all answers I could find so far seem incomplete. The answers depend on how the question is phrased:   If the question is phrased as "Why do we need Wire-3 in addition to Wire-2" the answer is because "Wire-2 may be at a substantial potential difference to its surroundings/user and thus endanger him/her if he/she ever comes in contact with it or Wire-1". If the question is phrased as "Why do we need Wire-2 in addition to Wire-3" the answer is because "Wire-2 is needed to form a closed electrical circuit" or phrased somewhat differently "Wire-2 is needed to create a potential difference to Wire-1 and thus for current to flow" .. with the argument further being that when taking practical considerations into account Wire-3 can't provide a reliable/stable potential difference to Wire-1 like Wire-2 can.   This doesn't really answer why there's a need to differentiate between Wire-2/Wire-3 though, considering how    Wire-3 remains Wire-3 and maintains 0V potential difference to its surroundings/user, regardless of whatever else happens around it .. since that is what it's supposed to do, or phrased differently, since that is the reason for Wire-3 being useful in the first place .. right?   and   Wire-2 is connected to Wire-3   What am I missing here?    Why is it safe to touch Wire-3 but not Wire-2, or why can Wire-3 provide a level of protection that Wire-2 can't?  Why differentiate between Wire-2 and Wire-3 at the power socket but then connect them further down the line?


Just wondering how to password protect and encrypt a folder in the Ubuntu 20.04 terminal (not OS)? Any help is appreciated Thanks

I have some important documents that I need to protect from anyone else having access to my machine.   The problem being the other persons have access to my machine via root account so changing the file permissions is not a option for me. I have seen apps like cryptkeeper but I was wondering can I password protect my files/folder by command line mode in ubuntu.


I would like to use a displace modifier for a room (its form is rectangular). But somehow only its sides are affected and not also the up and down. How can i affect this modifier to these parts, too?

A Displacement modifier is doing a great job making a mesh look a realistic object, but there are certain spots, such as a dozen or so vertices at one corner of the mesh, where I don't want any displacement effect.  The displacment is making a mess of things in those spots.  I don't want to undo my brilliant sculpting work there and re-do it after applying the modifier, or to fix the mess afterward. In fact, I don't want to apply the modifier.  Never mind my particular reason, since other Blender modelers may have the same question and want to animate, adjust the Displacment settings later, copy the object but have different ripples in the objects (using global coords), or whatever.  What would be nice is a way to modulate the "strength" setting with a grayscale image or painting in a UV map, but I'm not seeing how to do that.  I'm one of: unlucky at Google today, stupid, or ignorant of some non-obvious feature in Blender.  Maybe there's a nodes editor way to build a processing pipeline for modifier parameters?


Let $V$ be a vector space with inner product. If $W$ is a closed subspace of $V$ we always have $W\subseteq W^{\perp\perp}$. Now, I found a proof where the equality holds if $V$ is Hilbert. It is an easy consequence of $V=W\oplus W^{\perp}$. So my question is if this is not true if $V$ is not Hilbert. Does anyone know a counterexample?  Thank you.  Edit: Oh, sorry if I didn't clarify. I'm still suppossing $W$ is closed.

I am looking for an example such that in a pre-Hilbert space $H$ we have for a subspace $U$ that  (i) $\bar{U} \oplus U^\perp \neq H$  (ii) $ \bar{U} \neq U^{\perp \perp}$  Since finite and closed subspaces will probably not do it, I am not good at inventing nice examples. Does anybody here have a few at hand?


Is there an inbuild method in JavaScript for calculating time complexity of algorithms?   For instance, if I feed in this function:  function solution(A) {     let smallestInt = 1;      function existsInArray(val) {         return A.find((a) => a === val);     }      for (let index = smallestInt; index < 1000000; index++) {         if (existsInArray(index) && !existsInArray(index + 1) &&             existsInArray(smallestInt)) {             smallestInt = index + 1         }     }     return smallestInt; }   The method should be able to tell me that the time complexity of the algorithm is O(N*2) or whichever correct answer would be?  If no inbuild method is available, is there a library with automated methods for achieving this?

I wonder whether there is any automatic way of determining (at least roughly) the Big-O time complexity of a given function?  If I graphed an O(n) function vs. an O(n lg n) function I think I would be able to visually ascertain which is which; I'm thinking there must be some heuristic solution which enables this to be done automatically.  Any ideas?  Edit: I am happy to find a semi-automated solution, just wondering whether there is some way of avoiding doing a fully manual analysis.


I was told in my physics class that more amount of current goes through less resistance wire and if there is a zero resistance wire all the current will go through it in a parallel arrangement.

The current is maximum through those segments of a circuit that offer the least resistance. But how do electrons know beforehand that which path will resist their drift the least?


Can I use a 13.5VDC 1a power supply for a keyboard that requires a 10VDC 800ma power supply without ruining the keyboard? I was told that the keyboard would only draw the power and amperage it needed and the higher DC voltage and amperage from the power supply would NOT ruin the keyboard. IS THIS TRUE?

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


My system has Dual OS installed in hp laptop , Windows 10 and Ubuntu 20.04 LTS have not been a problem for a long time .Now Ubuntu does not boot, Windows loads automatically, why such a problem.

I installed Ubuntu on a Dell XPS 13 laptop that had Windows 10 preinstalled on it. I installed it from a USB flash drive on a partition. When I boot my computer I can only boot into Windows 10 and Ubuntu is nowhere to be seen.  If I boot into my USB then I can see that Ubuntu is installed, but I can't get to it from the BIOS boot menu.


I'm trying to delete  from the , because I don't think this network is suited for it. Then again when I go to:     I don't want to receive any messages from this network again and I don't want to add Stack Exchange to my  or as spam.  What can I do?  UPDATE  The question is different to the delete my acount one because the option to remove my profile wasn't there and I was getting a page with a 404 code.

How can I delete my Stack Exchange account(s)? Also,  What happens to my content? Can I request it be deleted as well? What if I'm suspended, rate-limited, or banned from posting questions or answers? What will happen to my votes? Will other users be impacted? Why wasn't my account deleted immediately after the timer expiring? What will happen to my pending bounties and close, reopen, delete, or undelete votes? I want my account deleted on all Stack Exchange sites. How do I do this? Will my profile on chat be removed once I delete my site account?   For more information, see "" in the .


What do you think would happen if Hiccup and Toothless find more Night Furies? Would they accept Toothless the way that he is?

(Hiccup reading)      Night Fury: Speed: Unknown. Size: Unknown. The unholy offspring of lightning and death itself. Never engage this Dragon. Your only chance, hide and pray it does not find you.   -     Hiccup      You know, I just happened to notice the book had nothing on Night Furies. Is there another book? Or a sequel? Maybe a little Night Fury pamphlet? WHOA!   In the original How To Train Your Dragon, when Hiccup looks up the existing information about the Night Fury dragons, everything is listed as being "unknown", yet everyone seems to be able to immediately identify that Toothless is a Night Fury.  This continues into the second movie, where Eret, Valka and Drago all immediately recognize the species. Valka states that Toothless may be the last surviving Night Fury.   The Night Fury species seems to be awfully recognizable for a species that is supposedly all but extinct, and that no information is known about it.     What happened to the rest of the Night Fury dragons? Is this addressed in any of the extra materials, or in any of the books?


I wish to draw the following graph:    which has 3 functions. (Then I just add different constants to get more lines.)  x-r=t, r<0, x<0 x=r, r>0, x>1 (x-r)/(1-r)=t, 0  with the (x-r)/(1-r)=t 'stopping' at the point (1,1).  I can get it all apart from the 'stop'.

I wish to graph this  This graph has 3 functions on it  t=x-r, r<0, x<0 x=r, r>1, x>1 (x-r)/(1-r), 0  My problem is I am wishing to stop the (x-r)/(1-r) lines at the point (1,1) as seen in my drawing below. Could anyone help me with this please?  Currently have this, also struggling with drawing the vertical lines.  \documentclass[border=2mm]{standalone} \usepackage{pgfplots} \begin{document}     \begin{tikzpicture}         \begin{axis}[             xmin=-1, xmax=1.5,             ymin=0, ymax=1.5,             axis lines=center,             axis on top=true,             domain=-2:3,         ]             \addplot [mark=none,draw=red,ultra thick] {x+1};             \addplot [mark=none,draw=red,ultra thick] {x+2};             \addplot [mark=none,draw=red,ultra thick] {x+1.5};             \addplot [mark=none,draw=red,ultra thick] {x};             \addplot [mark=none,draw=red,ultra thick] {x+0.5};             \addplot [mark=none,draw=green,ultra thick] {(x-.5)/(1-.5)};         \end{axis}     \end{tikzpicture} \end{document}


I have read many answers here about gravitational potential energy. Suppose that I am holding a ball 5 meters from the ground and I release it and it falls to the ground. Now i get that it falls because I did work against gravity to lift that ball to the height of 5 meters. But my question is that why did I have to do work against gravity? I mean where does gravity get the energy to pull the ball so that I have to do work to lift it? I hope you get my question.

I would like to know where gravity gets its energy to attract physical bodies?  I know that the law of conservation states that total energy of an isolated system cannot change. So gravity has to be getting its energy from somewhere, or else things like hydropower plants wouldn't be able to turn the power of the falling water into a spinning rotor.  Just to be clear, Lets create an example:  Lets say we have two objects with equal mass close to each other. So gravity does its job and it pulls each other closer, this gets turned into kinetic energy. This is where I'm lost. According to the law of conservation energy can't be created or destroyed and the kinetic energy comes from the gravitational pull so where does the gravitational pull gets its energy.  If that energy isn't being recycled from some where else then that means you have just created energy, therefore breaking the law of conservation.


I would like to rotate text inside a table and align to the centre as shown. The next column has several other rows which are combined in the "standards" row. Something similar to the first picture(aligning with the vertical line) and not the second. I would appreciate suggestions on the best way to do this. Thanks

\documentclass[fleqn,12pt,a4paper]{article} \usepackage{tabularx} \begin{document}   \begin{table}[ht]     \begin{minipage}[b]{1 \linewidth}\centering       \begin{tabular}{|c|c|c|c|c|}       \hline         Tri Sankhya & Vihbakti & Ekavachana & Dvivachana & Bahuvachana \\       \hline         Pra Trik    & Prathama & Su (s)     & Au &  \\         Dvi Trik    & Dvitiya  & Am         & Aut (Au) &  \\         Tri Trik    & Trutiya  & Ta (A)     & Bhyam & \\          Cha Trik    & Chaturthi& Ne (E)     & Bhyam & \\         Pan Trik    & Panchami & Nasi (as)  & Bhyam &   \\         Shas Trik   & Shashthi & Nas (as)   & Os &   \\         Sap Trik    & Saptami  & Ni (ee)    & Os &   \\       \hline       \end{tabular}       \caption{Subanta Pratyaya}     \end{minipage}   \end{table} \end{document}    In the attached image, I would like to place text in the last column at 90 degree rotation but do not know how to do it. Also, how can I color the background of that entire column only.  .


Question: Is the following statement true?    Statement: Let $a, b \ge 1$ be coprime numbers. Then $\exists N \ge 0 $ $\forall n \ge N$ $\exists u, v \ge 0$ with $n=au+bv$. Let $N(a,b)$ be the smallest possible $N$. Then $N(a,b) = (a-1)(b-1)$.

This seemingly simple question has really stumped me: How do I prove that the largest integer that can't be represented with a non-negative linear combination of the integers $m, n$ is $mn - m - n$, assuming $m,n$ are coprime? I got as far as this, but now I can't figure out where to go:  $mx + ny = k$, where $k = mn - m - n + c$, for some $c > 0$ $\Rightarrow m(x + 1) + n(y + 1) = mn + c$  If I could only prove this must have a non-negative solution for $x$ and $y$, I'd be done... but I'm kind of stuck. Any ideas?


Given $n$ distinct elements.  Is there a sorting algorithm which ensures that every element is compared atmost $\lg n$ time?  Or is there a higher lower bound?

Are there any known comparison sorting algorithms that do not reduce to sorting networks, such that each element is compared $O(\log n)$ times?  As far as I know, the only way to sort with $O(\log n)$ comparison on each element is to construct an AKS sorting network for $n$ inputs, and run the input on the sorting network.  AKS is not easy to implement and has an impractical constant factor, so there are motivations to search for other algorithms.  An algorithm with $O(\log^2 n)$ comparisons per item which does not seem to imply a sorting network is presented . (iirc, this was first presented by  at Stony Brook's algorithm seminar).


Actually the tittle not correct at all but I can't find any words to describe my problem. I'm using blender and ripper for reach to my favorite game's map.   I don't have any problem importing etc. This my imported model;   As you see, there is too much grass, rocks and trees on the terrain of mesh. This is my problem. Is there any way to remove other-terrain objects in blender (or any other modelling software)? The terrain is continious but other objects start vertices have an angle bigger than normal angle which used by terrain continue vertice. Look that image:    Otherwise, if you see the second image, the terrain have tilled (e.g. 2x2, 4x4 I don't know the magnitude) squares basically. Maybe this can give a way for solve my problem. Is there any way?   Thank You..

I want to make the teeth a separate child object from the mouth. I want to know the best way to do this.   I have tried going into edit mode with Tab and trying to select all the vertices but that doesn't move the teeth. Is there an easy way to select just that part and make it a separate child mesh to the rest of the mouth?


What are some major implications of a proof of the Riemann hypothesis?

I've recently been reading about the Millenium Prize problems, specifically the Riemann Hypothesis. I'm not near qualified to even grasp the entire problem, but seeing the hypothesis and the other problems I can't help wonder: what is the practical use of solving it?  Many researchers have spent a lot of time on it, trying to prove it, but why is it so important to solve the problem?  I've tried relating the situation to problems in my field. For instance, solving the $P \ vs. NP$ problem has important implications should it be shown to be either $P = NP$ or $P \neq NP$: for instance, cryptographic algorithms, but it's hard to say WHY the Riemann Hypothesis, or other problems, are so important.  Perhaps a partial answer could be made by seeing which solutions proof of the Poincaré Conjecture has lead to.


In doFilter method, we use the code below to access to session :  HttpServletRequest request = (HttpServletRequest) servletRequest;   But, "HttpServletRequest" extends "servletRequest", so theoretically we should not be able to put father in son.

Upcasting is allowed in Java, however downcasting gives a compile error.   The compile error can be removed by adding a cast but would anyway break at the runtime.   In this case why Java allows downcasting if it cannot be executed at the runtime? Is there any practical use for this concept?   public class demo {   public static void main(String a[]) {       B b = (B) new A(); // compiles with the cast,                           // but runtime exception - java.lang.ClassCastException   } }  class A {   public void draw() {     System.out.println("1");   }    public void draw1() {     System.out.println("2");   } }  class B extends A {   public void draw() {     System.out.println("3");   }   public void draw2() {     System.out.println("4");   } }


I'm not able to edit the question. Can anyone tell me what's the reason behind that? On hove that it will be show "Account is not allowed to suggest edits"

I edited some questions before, but now I get an error message when clicking the edit button. I thought there was a problem with the specific question, but I cannot click it on any question.  What's going on?


I am a graphic designer and I wanna buy a Pantone colour guide book, the pair one for coated and uncoated colours which compares the Pantone color with its CMYK version?Any advise which pait is the best? Thanks!

I'm trying to find the best way to match specific colors across different media (print and digital) for doing identity/branding work for a company. From what I've read pantone matching systems is the industry standard?  If so my second question is whether to get the formula guide or the color bridge as I don't really get the difference between the two?   Here are the links to the two items as shown on pantone's site:


I remember reading a book in the late '80's early '90's  (it might even be a series) about a time traveler that travels back to medieval times.   The only character name I can remember is his robotic horse named N.E.S.T.O.R. or N.E.S.T.R.

I'm trying to remember a series of stories (I think there was 3-4 books in the series) about a planet hopping adventurer / lawman / aristocrat who had a mechanical horse called Fess or Fez (or something like that). The only thing I can remember is it suffered from seizures at the most inopportune moments.


can anyone please let me know difference between count(*), count(1), count(0), count('FAST')

I seem to remember that (on Oracle) there is a difference between uttering select count(*) from any_table and select count(any_non_null_column) from any_table.  What are the differences between these two statements, if any?


The Ubuntu 20.04 installer supports a ZFS root filesystem, which works well until an install or update involves touching the grub configuration. I have tracked down what looks like the root cause in /etc/grub.d/10_linux What is the best way to contact one of the developers that works on grub?

I found a problem with an application on Ubuntu.   Questions :   How do I best report the issue?  What sort of information should I provide?


Im currently creating a breakout clone for my first ever C# / XNA game. Currently Ive had little trouble creating the paddle object, ball object, and all the bricks. The issue im currently having is getting the ball to bounce off of the paddle and bricks correctly based off of where the ball touches the object. This is my forumala thus far:  if (paddleLocation.Intersects(ballLocation)) {     position.Y = paddleLocation.Y - texture.Height;     motion.Y *= -1;      // determine X     motion.X = 1 - 2 * (ballLocation.X - paddleLocation.X) / (paddleLocation.Width / 2); }   The problem is, the ball goes the opposite direction then its supposed to. When the ball hits the left side of the paddle, instead of bouncing back to the left, it bounces right, and vise versa. Does anyone know what the math equation is to fix this?

I'm trying to wrap my head around this very Hello World-y problem in game development. I've created a TicTacToe game in XNA so I guess the next step would be a  clone.  Keep in mind that I have no knowledge on game programming or even what maths I should apply to where. That's why I'm asking this question.    To the question: How can I determine where the ball should bounce when it hits the paddle at the bottom of the screen?  I'd imagine it would be something like:   Capture speed and angle from incoming ball. Detect where it touched the bar (far left, far right, center) and according to that give it a higher speed if it touched the outer areas. This is where I'm stuck. Hehe.   Any insights? I realize this is not a straightforward answer type question, but I'm sure it's one everyone faces at some point.  I'm reading the book Linear Algebra that was recommended on this website, but I still have no idea if I should apply it here.


I have a element that append to body when user click on a button. I want to remove appended element by clicking on it. How can I  do this?     Code         $("#btn1").click(function() {       $("body").append("

");   });   $(".someClass").click(function() {       $(this).remove();   }); .someClass{   width:100px;   height:100px;   background:green; }  <button id="btn1">append div</button>

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


My laptop screen is working but I can only get the secondary display working when I close the laptop lid after turning on power. I believe external monitor starts up after the windows logo and such so much too late to go to BIOS.

Lately my laptop (HP g42 247sb) screen is damaged, so I hook it up with an external monitor (LG something) and it works fine now.  The only annoying thing is I cannot navigate the BIOS menu for some tweaking because the BIOS not shown on the external monitor, instead, it only shown on the broken laptop screen, and  it only output to my external monitor when Windows/OS is logged-on.  So, is there anyway I can force output during BIOS/BOOT/POST to my external monitor?  Things I have done and didn't work:   Set my LG monitor as primary display on both window properties and Intel Graphics panel  Enter the BIOS (F10 key) and press the Fn+F4 key (change display output). Disable and uninstall my internal screen (broken laptop screen) using device manager and restart, but Windows (BIOS?) install it back on log-on. Closed lid/Magnet on sensor.


In c++, I want to send a command to the terminal(system()) and then send whatever output the terminal shows into a variable, but I don't know how. I'm aware of the std::getline() function, but I'm not sure that would do the trick. If you know a way to complete this task, please let me know. Thanks in advance.

I am looking for a way to get the output of a command when it is run from within a C++ program.  I have looked at using the system() function, but that will just execute a command. Here's an example of what I'm looking for:  std::string result = system("./some_command");   I need to run an arbitrary command and get its output. I've looked at , but I have not found anything that will give me what I need.


As a kid, I was taught that that blue and yellow make green, yellow and red make orange, and red and blue make purple - forming the subtractive color wheel. As an adolescent I was taught that blue and green make cyan, green and red make yellow, and red and blue make magenta - forming the additive color wheel. Somewhere in that time I was also taught that the colors of the rainbow are ROY G. BIV.  That last one is the only one that makes much sense to me in physics because perceivable light is not somehow a cycle, but rather a tiny segment of the EM spectrum.  Why do the colors at the top and bottom of the spectrum seem to be mixable? Is there anything in nature that indicates this should be the case? Is this just a psychological or physiological phenomenon?

When people are asked to match monchromatic violet light with an additive mix of basic colours, they (paradoxically) mix in red.  In fact, the CIE 1931 color space chromaticity diagram shows this effect begins at about 510nm (greenish-cyan), where people mix in no red.  From that point on, the higher the frequency of the light source, the more red they mix in.    This effect is reflected by the red curve of the , which has an additional bump in the area of blue light.  However, that curve does not match the actual spectral sensitivity of red cones.  So where does this additional perception of red at higher frequencies come from?


I have obtained a large chunk of approximately week old moose meat that has been never stored in a freezer. I'm planning to eat it during the next week or two.  I cut it to 8 smaller steak-sized chunks, and cut 4 of those into small bits of which I'm going to make moose stew with carrots and onions. I'm just fried the small bits in my frying pan, and am currently making the stew in my pot.  The trouble is, I don't have a large frying pan or a large pot. I only have one small pot which I have free to use for the moose stew. The small bits of half of the moose meat fit in there with carrots and onions.  What should I do for the 4 other steak-sized chunks?   Should I just store them unfried in the refrigerator and cook when I need to, which will be approximately week from now? (Currently they are in the refrigerator, but I can always fry them in my frying pan that is free now.) Should I fry them in my frying pan and store them in the refrigerator after frying them?   I want to maximize the amount of time the meat stays edible. If it stays edible for only one week from now, I have to eat moose meat every day. If it stays edible for two weeks, I can eat moose meat only every other day.  I of course theoretically have the option of just storing the rest in my freezer, but my freezer (or actually two freezers) are half full with frozen moose meat!

How do I know if a given food or ingredient I have is still good, or if I should discard it?  How can I best preserve a food or ingredient?     This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.


If $a,b,c$ are positive integers and  $\gcd(a,b,c)$ is $1$. Given that $\frac{1}{a} + \frac{1}{b} = \frac{1}{c}$ then prove that $a+b$ is a perfect square.  I was trying to get something useful from the information given in the question but was unable to get that.

If $1/a  +  1/b  =  1 /c$   where $a, b, c$ are positive integers with no common factor, $(a + b)$ is the square of an integer.  I found this question in RMO 1992 paper !  Can anyone help me to prove this ?  May be it's too easy and simple . But , I'm just novice in number theory !


I was looking at  question a few minutes ago, and a thingy popped up that said                                 1 new answer to this question   I was busy at that moment, so I didn't load the answer immediately. When I did, though:        Notice the distinct lack of answers   I ran from the room, screaming in terror at the phantom answer. After refreshing the page, it disappeared:        Notice the distinct lack of answers   I assume that it was an answer that got deleted before I loaded it.

While perusing a question on Stack Overflow, I was presented with the familiar "X new answer to this question, click to refresh". When I did, I was presented with the following:    This pattern continued with "4 new answers" and "5 new answers", at which point I got bored watching it and came here to report it.  FWIW, the correct number of answers was displayed when I did an F5 on it.


I understand the reason 1 is not considered to be a prime number, but what is the reasoning for -1 not being considered a prime number? It's only factors are 1 and itself, -1, wouldn't that make it a prime number?

Do we have negative prime numbers?   $..., -7, -5, -3, -2, ...$


I'm playing around with a PHP/MySQL. I can't devise what is "better" and why ?  This isn't really a direct technical question but more of a efficiency related question.  I'm trying to pull 1 row from a table, this is the general code:  $query=mysqli_query($con,"SELECT * FROM `tracked_sites` WHERE checkType =1"); while ($row = mysqli_fetch_assoc($query)) {     echo $row["domain"] . "<br/>"; }   This works and everything is just fine, however I could also do it using a more specific query, instead of using wildcard. I could just specify the domain and it would trim down the results to just that row.  I'm trying to understand what would be the impact (if any) on larger dbs (lets say 10M or 100M items)?

I've heard that SELECT * is generally bad practice to use when writing SQL commands because it is more efficient to SELECT columns you specifically need.  If I need to SELECT every column in a table, should I use   SELECT * FROM TABLE   or   SELECT column1, colum2, column3, etc. FROM TABLE   Does the efficiency really matter in this case? I'd think SELECT * would be more optimal internally if you really need all of the data, but I'm saying this with no real understanding of database.  I'm curious to know what the best practice is in this case.  UPDATE: I probably should specify that the only situation where I would really want to do a SELECT * is when I'm selecting data from one table where I know all columns will always need to be retrieved, even when new columns are added.   Given the responses I've seen however, this still seems like a bad idea and SELECT * should never be used for a lot more technical reasons that I ever though about.


It is often written:   /usr/bin/test is a synonym for /usr/bin/[ [[ is a bash improvement for [ test and [ are also builtins   I understand the difference between [ and [[ but I am confused with the binary vs. builtin relationship here. What is really used in my scripts when I use [ or [[ if /usr/bin/test and /usr/bin/[ are also present in my system?  In the manpage for test, there is missing the often-used option -a, which is listed in help test. I would guess [ is used as a builtin, if this option works.

Some commands are provided as both builtins and external utilities. Take echo for example. On my machine (macOS) running Bash 3.2,  $ type echo echo is a shell builtin   Running man bash | less --pattern='^ *echo +\[' shows:   echo [-neE] [arg ...]    But running man 1 echo shows a man page for a different implementation of echo, with a different signature:   echo [-n] [string ...]    I'm able to use -e successfully, so I must be running the builtin, and presumably that's /bin/echo  $ which echo /bin/echo   Where does the other implementation live, and how can I distinguish between builtins and external utils in general (e.g. printf)  Update/Correction Thanks @Gilles for clarifying. And the proof is in the pudding!  $ /bin/echo -e "\tabc" -e \tabc  $ echo -e "\tabc"         abc


In a domain name registrar you have the option to set name servers as such: ns1.example.com, etc. and you don't have to specify the IP address of the name servers.   Well, what if I create a set of name servers and have them set as someone else's domain?   What is stopping the domain name from resolving to the lookalike DNS servers I just created ?   example:  Say you have a domain, peanuthead.com. You go to digital ocean and create two name servers with BInd9: ns1.peanuthead.com and ns2.peanuthead.com. you go back to your registrar and set your name servers to ns1.peanuthead.com and ns2.peanuthead.com. this means when you go to peanuthead.com it will query thoes dns servers.   What if someone randomly creates two name servers that you created, ns1.peanuthead.com and ns2.peanuthead.com? what stops the domain peanuthead.com from querying those name servers created by someone else?

When specifying DNS information for a domain (e.g. in the registrar control panel) one can use nameservers which are subdomains of the domain. For example, if I have a domain example.com, I can set nameservers "ns1.example.com 1.1.1.1" and "ns2.example.com 1.1.1.2" (IP-addresses are mandatory). What is the process of resolving the name ns1.example.com?


We have that $I=(2)$  is maximal in $\mathbb{Z}$ because $(2)\subseteq (4)\subseteq \dots \subseteq (2^k)$, right?   Why is $I[x]$ not maximal $\mathbb{Z}[x]$ ?

Let $I = \langle 2\rangle$. Prove $I[x]$ is not a maximal ideal of $\mathbb Z[x]$ even though $I$ is a maximal ideal of $\mathbb Z$.   My professor mentioned that I should try adding something to it to prove that $I[x]$ is not the maximal ideal. I want to assume he meant to add $ \langle 2 \rangle$ to $I[x]$?


I doubt that the concept of work-energy was actually discovered this way. However in the algebra based physics book I am reading, work done by a constant net force is defined as $W = fcos \theta s$ The other side of the equation is worked out to be $\Delta 1/2(mv^2)$ or $mg\Delta h$. This is the work energy thereom given. The right sides are given names KE and GPE.  To me this is just deriving equations using substitutions and transposing. Without being given explanations of what KE and GPE are, how would a person know their meanings? W=$fcos \theta s=1/2(mv^2)$ They are just equivalent expressions.  How would one go from that to knowing $1/2(mv^2)$ KE is energy possessed due to its motion? That this can do negative work if acting on another object? Or likewise the mgh is PE and is independent of the path taken between two points making a line perpendicular to the earths surface?  Please don't use any mathematics beyond a 1st year undergraduate course to explain as I wont understand it.

My questions mostly concern the history of physics. Who found the formula for kinetic energy $E_k =\frac{1}{2}mv^{2}$ and how was this formula actually discovered?  I've recently watched Leonard Susskind's lecture where he proves that if you define kinetic and potential energy in this way, then you can show that the total energy is conserved. But that makes me wonder how anyone came to define kinetic energy in that way.  My guess is that someone thought along the following lines:     Energy is conserved, in the sense that when you lift something up   you've done work, but when you let it go back down you're basically   back where you started. So it seems that my work and the work of   gravity just traded off.   But how do I make the concept mathematically rigorous?  I suppose I need functions $U$ and $V$, so that the total energy is their sum $E=U+V$, and the time derivative is always zero, $\frac{dE}{dt}=0$.   But where do I go from here? How do I leap to either   a) $U=\frac{1}{2}mv^{2}$ b) $F=-\frac{dV}{dt}$?    It seems to me that if you could get to either (a) or (b), then the rest is just algebra, but I do not see how to get to either of these without being told by a physics professor.


I want to create a shape like a pipe, like below image and blend file.  I created the mesh below in Houdini, but I could deal with it only in simple case, and I couldn't improve it any more in Houdini. So I am trying blender.  .blend file:     What "non-uniform cross-section" means both 1. and 2.   scaling independently on each axis of cross section changing the cross section shape.   I tested the below but I have trouble in all of them.   I can't use "Curve Bevel Function" (, ) because this can use only one cross section. Even if I use Bevel Object, Alt+S, Proportional Editing and Taper Object, We can't use multiple different cross section shapes and We can't scale independently on each axis of cross section. I also tried vertex group + proportional editing () but failed. I tried addons  and . These may be solution, but I have trouble when pipe length is long like this case.   Could you tell me effective way to create a pipe which has non-uniform cross-section ?  I don't think my question is duplicate of  because my question emphasises the non-uniform cross section and mentioned that Curve Bevel function doesn't allow us to use non-uniform cross section.

Is there a way to scale up the bevel object on one end of a curve, a little bit over each point?  I notice the vertex "weight" slider will tweak how much influence each vertex has on the others, is there something like this that can scale the bevel object up a little bit?  Preferably with the option to constrain X,Y,Z independently


I'm running an i7 quad core with 16gb ram and an SSD. My proc maxes out at 100% routinely, and sometimes my ram goes into swap.  This happens with Gnome or Unity. My laptop runs arch, and I'm seriously thinking of jumping ship, even if installing arch is a massive pita.  The 'top' command shows a process called "Web Content". That and systemd-resolve, and occasionally dnsmasq are gunking up my CPU resources.  What do I do?

I have recently upgrade my Xubuntu from 16.10 to 17.04.  Every things works well except systemd-resolve. some times it makes cpu usage too high and I don't know why this issue has been happend.  And here is the top command output:    PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                  1114 systemd+  20   0   51532   6744   4504 R   100  0.0   9:51.67 systemd-resolve                          1152 dnsmasq   20   0   64360   2892   2480 R  38.9  0.0   4:05.53 dnsmasq                                  1245 root      20   0  376644  89644  64436 S   1.7  0.5   0:35.69 Xorg                                     1624 asus      20   0  370160  45820  28488 S   0.7  0.3   0:00.90 python2                                  2238 asus      20   0 2562816 553112 128492 S   0.7  3.4   2:41.20 firefox                                    16 root      20   0       0      0      0 S   0.3  0.0   0:01.05 ksoftirqd/1                               708 root     -51   0       0      0      0 S   0.3  0.0   0:01.20 irq/95-ELAN1000                          1302 root     -51   0       0      0      0 S   0.3  0.0   0:03.68 irq/142-nvidia                           1734 asus      20   0  483388  11060   8560 S   0.3  0.1   0:05.45 conky                                    2820 root      20   0       0      0      0 S   0.3  0.0   0:00.14 kworker/5:1                              3420 asus      20   0   53384   3932   3200 R   0.3  0.0   0:00.76 top                                      I don't know why this issue has been happend but usually it's occured when run some commands like sudo apt update .  (I'm using tor and obfs4proxy,  It's may be helpful for answer)


Which of the following polynomials has the greatest real root? $\textbf{(A) }   x^{19}+2018x^{11}+1   \qquad$        $\textbf{(B) }   x^{17}+2018x^{11}+1   \qquad$    $\textbf{(C) }   x^{19}+2018x^{13}+1   \qquad$   $\textbf{(D) }  x^{17}+2018x^{13}+1 \qquad$  $\textbf{(E) }   2019x+2018$   To 'find' real roots we can set each expression $A$ to $E$ equal to $0$, which makes it pretty clear that the value $x$ must be negative (for else they'd be huge positive numbers), but also pretty small, since the terms with variable $x$ in each expression (despite their coefficients) must equal $-1$, for (A) to (D). $x=-1$ or $x=0$ will not work, however, so we need $x$ to be $-1<x<0$.   For (E) we can just solve for $x$ from $2019x + 2018=0$, but that gives an $x$ pretty close to $-1$ and I need to see if there are any greater roots (i.e. closer to $0$).   However, now I'm stuck and don't know how to move on. Any help would really be appreciated!

Which of the following polynomials has the greatest real root? $\textbf{(A) }   x^{19}+2018x^{11}+1   \qquad        \textbf{(B) }   x^{17}+2018x^{11}+1   \qquad    \textbf{(C) }   x^{19}+2018x^{13}+1   \qquad   \textbf{(D) }  x^{17}+2018x^{13}+1 \qquad  \textbf{(E) }   2019x+2018$  The only root that I was able to find was the last one. I have no idea what to do from here. Does anyone have some ideas?


Accidentally did :  chmod -R 777 /   Now, RHEL 6 is not booting up.    What do I do? I have a DVD and can go into rescue mode.   Can someone explain how do I reset all the permissions ?  Update Actually it boots, and then reaches to a screen where it displays Redhat logo along with some text localhostXXX. But after that nothing happens. It is not going to the  login screen.

I was trying to run chmod -R 777 ./ but ended up typing chmod -R 777 / and set 777 on my entire machine. What can go wrong? How can I fix it?


This code works fine, I mean the multi thread part.. the only problem is that I get a NPE just only if I call save method     Exception in thread "pool-1-thread-1" java.lang.NullPointerException           at app.Controller.handleClient(Controller.java:54)           at app.Controller.run(Controller.java:109)           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)           at java.lang.Thread.run(Unknown Source)   How can I handle this? Thank you  coding section  BlockingQueue<Client> clients_list;  ExecutorService executor = Executors.newFixedThreadPool(10);  for (Client client: clients_list) {         Runnable worker = new Controller(client);         executor.execute(worker); }  public Controller(Client client) {         this.client = client; }   // Controller class implements Runnable, here run method     @Override     public void run() {         // do some stuff on client         // then save data into a file         handleClient(client);     }  private void handleClient(Client client) {     String c_rwx = client.getPermission()     if(c_rwx.contains("allowed to:")) {        client.setUsername = client.getUsername() + " allowed" ;        save(client);     } }  private void save(Client client) {         FileWriter fw = null;         try {             File file = new File("done.txt");             if (!file.exists()) {                 file.createNewFile();             }             fw = new FileWriter(file, true);             fw.write("client info:" + client.getUsername() + " \n");             // ...             fw.flush();         } catch (IOException ex) {             System.out.println("err saving file");         } }   FIXED EVERYTHING added after the for  executor.shutdown();

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I think I have accidentally messed up my Ubuntu, I wanted to remove TOR so I did sudo apt-get remove tor* That selected a lot of files, which I think is unrelated to the anonymity network. So I ended up deleting files that other packages need. How can I make a scan for the missing dependencies I have removed?

I am running a Linux instance on ec2, snap sorting of image is disabled.  While trying to un-install open-jdk from the system. I stupidly run the command  sudo apt-get remove open*   It started removing many packages, so I stopped the process by Ctrl+C.  I did it twice:   sudo apt-get remove open* sudo apt-get remove openjdk*   I stopped the process (Ctrl+C) in between for both of them.  Now I see that my other application are not working, because of the packages removed.  Please advice, how can I go back to the state before apt-get remove.  Thanks in advance.


I ran:  sudo apt-get update sudo apt-get upgrade   on my terminal.  After that, neither the "muon update manager" nor the "muon software center" work, when run, they both give an error:  Initialization Error  The Package system could not be initialized, your configuration may be broken.   Details  Encountered a section with no package: header   I tried restarting the computer, update, upgrade a few times continually, and didn't help.  Then I tried:  sudo apt-get dist-upgrade   on a terminal and got a set of these errors:  Reading package lists... Error!  **E:** Encountered a section with no Package: header  **E:** Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty-security_main_i18n_Translation-en  **E:** The package lists or status file could not be parsed or opened.   Then I tried:  sudo dpkg --configure -a     sudo apt-get install -f    sudo apt-get update     sudo apt-get install muon --reinstall   but received the same errors quoted above for the lines 2 and 4  Does anyone know why I am having all of these problems or what I have done wrong?

The computer gave me this output in a window:  E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages E: The package lists or status file could not be parsed or opened.   How can I fix this?


Let $G$ be a nonempty open subset of $\mathbb{R}$ (with usual topology on $\mathbb{R}$) such that $x,y\in G$ implies that $x-y\in G$. Show that $G=\mathbb{R}$.  Clearly $0\in G$. Now how to show that all real numbers are there in $G$? Please help.

I am not able to find out what are all the open subgroups of $(\mathbb{R},+)$, open as a set in usual topology and also subgroup.


I've recently been learning about proof writing, and I really enjoy it, here's a proposition that I tried to prove but I'm not quite sure if it's correct: Proposition: $2^x=0$ has no real solutions Proof: By contradiction, assume $2^x=0$ has a real solution (i.e. when $x = \alpha$), then $$2^\alpha = 0\implies \frac{2^\alpha}{2^\alpha}=\frac{0}{2^\alpha} \implies 1=0$$ which is a contradiction $\therefore$ by contradiction, $2^x = 0$ has no real solutions.

I'm pretty confident that this is a valid proof, but I still need people who are better than me to confirm it, here's the proposition: Proposition: $2^x=0$ has no real solutions. Proof: By contradiction Assume $2^x=0$ has a real solution  (i.e. $2^x=0$ when $x=\alpha$), then $$2^\alpha=0 \implies 2^\alpha \cdot 2=0 \implies 2^{\alpha+1}=2^\alpha \implies \alpha=\alpha+1$$ Which is a contradiction because $\alpha=\alpha+1$ has no real solutions. $\therefore 2^x=0$ has no real solutions.


I'm going to select multiple objects in blender with script the name would be [cube101, cube102, cube103, cube104, cube105......] is there anyway to simplify the long script with [cube10*] to tell blender the objects I want are "something + *" ?

In my export script I wish to export all object named 'foo*' in one format, and all objects named 'bar*' in another format.  I could write 2 separate exporters that operate on the selection (so I select all 'foo*' objects and execute FooExporter,  rinse and repeat for 'bar*'  But I would rather get it done in one go, with:  fooList = get_objects_starting( 'foo' ) for obj in fooList:     foo_exporter( obj )  barList = get_objects_starting( 'bar' ) for obj in barList:     bar_exporter( obj )   How can I get a list of all 'foo*' objects?


I've been playing MtG for a while and recently came across protection from everything. It occurred to me: can two creatures with protection from everything block each other?  Or, can a blue creature with protection from red be blocked by a red creature with protection from blue?

Example 1) Let's say I have some random creature with protection from white, and my opponent plays , a white card with the effect "Destroy all creatures." Can my creature with protection from white be destroyed by a white card that isn't actually targeting it specifically?  Example 2) I was playing a match with a friend where I had  on the field against his 3 zombies. Is he able to declare his zombies as blockers even though Elite Inquisitor has "protection" from zombies?  If he can declare them as blockers, does protection mean that no damage is dealt by the zombies to  Elite Inquisitor?


On this forum, I have had many of the more experienced users tell me to tweak my format so that I eliminate badboxes.  I do not see the point of nitpicking my LaTeX code to eliminate badboxes.  I have many badboxes in all of my documents and they compile just fine.  So, my question is what is so bad about badboxes?

When I compile my PDF from LaTeX source, do I have to care about all the messages (currently 28) about 'bad boxes'?  The PDF seems fine to me.


At the bottom of all Stack Exchange sites, there is a gray area to navigate between Stack Exchange sites. Except on Area 51.   Can you put this bar at the bottom of Area 51?

Honestly, navigation through Area 51 is a bit confusing and seems to be much different from the other SE sites.    The feature that is very lacking is the footer with all the sites you are subscribed to so that a user can easily return to a different SE site. This one really bugs me.  Can this be easily fixed?  Also, unlike all the other sites there is no "meta" site to add comments specifically about that site.    Again Area 51 seems out of sync with the other SE sites.


I was writing a short snippet of code to figure out how I would store different template specializations into one data structure (e.g. vector). I'm aware of tuple but that's not good because I want to be able to append specializations after the tuple was constructed.  Below is a snippet of code that I came up with. In short, my idea was to have every template specialization inherit from a common class Element and then store such instances into a vector<Element>. That worked, but now when I access that data from vector, I access it as an Element. I need some way to find out which Element is paired with which template specialization.   Using typeid directly on elements from the vector returns the base type. I tried to work around that by having a member function runtime_type return that information from the subclass. Unfortunately, it's not working because the member function from SparseSet<T> is not overriding the virtual member function from the base class. I'm not sure why.  #include <vector> #include <iostream> #include <tuple> #include <typeinfo> #include <algorithm>  class Element { public:     virtual const std::type_info& runtime_type()     {         std::cout << " Called base ";         return typeid(*this);     }      virtual ~Element() = default; };  template<class T> class SparseSet : public Element { public:     T param;      const std::type_info& runtime_type() override     {         std::cout << " Called derived ";         return typeid(*this);     } };  class Manager { public:     std::vector<Element> elements;      template<class T>     bool has()     {         const auto it = std::find_if(elements.begin(), elements.end(), [](auto &element) {             std::cout << "typeid(element) = " << element.runtime_type().name() << std::endl;             std::cout << "typeid(T) = " << typeid(T).name() << std::endl;             return typeid(element) == typeid(T);          });         return it != elements.end();     } };  int main() {        SparseSet<int> ss_int;     ss_int.param = 3;      SparseSet<char> ss_char;     ss_char.param = 'a';      Manager manager;      manager.elements.push_back(ss_int);     manager.elements.push_back(ss_char);      std::cout << manager.has<SparseSet<int>>() << std::endl;      return 0; }   When I run the snippet above, using the online compiler  (g++ -std=c++17 -O2 -Wall -pedantic -pthread main.cpp && ./a.out), I get the following output.  typeid(element) =  Called base 7Element typeid(T) = 9SparseSetIiE typeid(element) =  Called base 7Element typeid(T) = 9SparseSetIiE 0

Someone mentioned it in the IRC as the slicing problem.


I was wondering why a balloon explodes after some time by itself with no specific reason. yesterday I was doing my chores and to my amazement the balloon far in the corner of house pop with no obvious reason.(the temperature had not changed before its explosion/usual conditions) I mean atmospheric pressure and pressure in balloon and force which balloon itself pushes are in an equilibrium. So what happens?

When we pierce a balloon with a sharp needle, it pops and produce a great sound. But, It doesn't pop when we open the mouth of the balloon (through which we have blown air)...  So, Why doesn't the gas release slowly when we pierce it with a needle. In fact, it is released slowly when we release the mouth.


I want to hide all *.o files from Nautilus in a specific folder. Is there a way to do it? If yes, how?

I have set of temp files created in my folder with .bak extensions. How can I make them hide by default in Ubuntu?  I tried adding a .hidden file with *.bak as entry in the file, but that is not working. Any help is very appreciated...


I usually render still images with very high samples(1000-5000) in cycles render engine.I leave this rendering on my desktop PC overnight. I was wondering if there is a feature/addon that can save the rendered image every 100 samples or every 30 mins or something of the sort. So that when I wake up in the morning and there was a power outage during the middle of the render, I still have a render close to the quality I wanted rather than none.

I am using cycles and progressive rendering. What I need to do is save all the images coming from intermediate stages. For example, I set the sample number to 500 and what I need to get is having 500 images with more and more samples used. Is it possible? I am new to blender. Sorry if I am asking for a very simple thing.  Best, Krzysztof


I have a table formatted like so:  title            source              subject    Bill hits Fred   newspaper 1/1/17    Bill      Bill hits Fred   newspaper 1/1/17    Fred Bill hits Fred   newspaper 1/1/17    Violence Mary likes pie   newspaper 1/4/17    Mary Mary likes pie   newspaper 1/4/17    Pie  Mary likes pie   newspaper 1/4/17    Apple John dies        newspaper 1/4/17    John  John dies        newspaper 1/4/17    Obituary ...   What I need to achieve is a query that finds all rows that have the same value for the title and source fields and combines into one record concatenating the subject field. ie the output for the above data would be:  title            source              subject    Bill hits Fred   newspaper 1/1/17    Bill, Fred, Violence      Mary likes pie   newspaper 1/4/17    Mary, Pie, Apple John dies        newspaper 1/4/17    John, Obituary ...   I figure I need to GROUP_CONCAT but am unsure of the exact syntax to compare title and source across all rows. Something along the lines of :  select title, source, GROUP_CONCAT(subject) from mytable WHERE   ??? <<-- not sure how to word the "title=title and source=source"   SOLUTION: I was missing GROUP BY:  SELECT title, source, GROUP_CONCAT(subject) from mytable GROUP BY title, source

Using MySQL, I can do something like:  SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;   My Output:  shopping fishing coding   but instead I just want 1 row, 1 col:  Expected Output:  shopping, fishing, coding   The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.  I've looked for a function on  and it doesn't look like the CONCAT or CONCAT_WS functions accept result sets.  So does anyone here know how to do this?


trying to install git on my ubuntu machine without a luck so far. Tried different things from different threads including below:  sudo apt-get update && apt-get upgrade && apt-get dist-upgrade sudo apt-get -f install sudo apt-get install git   Getting following error, when trying to install git with apt install git  The following packages have unmet dependencies:  git : Depends: liberror-perl but it is not installable E: Unable to correct problems, you have held broken packages.

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


When I write the following :  \documentclass[psamsfonts]{amsart} \usepackage{amssymb,amsfonts} \usepackage[all,arc]{xy} \begin{document} \[Q(M) :=\left[  \xymatrix{   &\Xi(j^*M) \ar@{->>}[rd]^{can}\\   j_!j^*M \ar@{^{(}->}[ru]^{can} \ar[rd]_{can}   &    & j_*j^* M \\   & M \ar[ru]_{can}  } \right] \] \end{document}   This is what it looks like:    I ended up getting Q(M) aligned to the first line of \xymatrix{}, and a huge empty space is inserted to the top of the content of \xymatrix{} in order to make Q(M) aligned to the middle of the bracket. This is ugly.  How can I solve this?

I'm making some slides where I want to show permutations with little diagrams of dots and arrows. Here is my attempt to depict the permutation 12345 --> 31245:  \documentclass{article}  \usepackage[all]{xy}  \begin{document} \[ \left( \xymatrix@R=1 em@C=1 em{ \bullet \ar[rrd] & \bullet \ar[ld] & \bullet \ar[ld] & \bullet \ar[d] & \bullet \ar[d]  \\ \bullet & \bullet & \bullet & \bullet & \bullet } \right) \] \end{document}   As you can see, there is a lot of white space at the top. How can I get the height of the xymatrix to only go up to the top of the dots?


I have a passport from Afghanistan with a Canadian visa in it. Do I need a transit visa in Paris or Amsterdam?

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


I am looking for an adjective for a person who, no matter what you give him/her (materially or otherwise), is never content and always expects more.

I'm looking for a word that means     someone (especially a boss) who is not pleased (with your work, attitude etc.) no matter how hard you try.


I just bought a HSOIC-8 LMR16030 and have tried to plugged it in my circuit but didn't manage to make it work. I'm thinking this might be due to me misunderstanding the pin configuration. What are the pin numbers in this picture?    Updated: Zoomed image (2x original dimensions on each side)

I am trying to identify Pin 1 of MAX3222E, the TSSOP variant (See Page 16 of ), but it doesn't have any corner mark!  Could someone suggest how to identify Pin 1 in this type of situation?  I don't have a high-res camera on me right now, but I do have the chip in front of me, so here's a drawing of everything I see on top (the + sign is just part of the full name MAX3222EEUP+):


If Olenna was counting on killing Joffrey with the poison in the necklace in  season 4, why was it given to Sansa? How could she possibly know that Sansa would wear it to the wedding?

What was the reason for the complicated plan to smuggle the poison that killed Joffrey in  S04E02 to the Purple Wedding? It's not like there's TSA-style security at the entrance, right? Or at least we never see any.  Why was it not possible to simply conceal the poison in the robes, directly on the person who actually adds it to the drink?


Is it possible to change the background (or window) color of open terminal window on Ubuntu GNOME environment? I would like to do this for tagging purpose when working with multiple terminals.

I am in the process of colorizing my terminal’s PS1.  I am setting color variables using tput; for example, here’s purple:  PURPLE=$(tput setaf 125)   Question:  How do I find the color codes (e.g. 125) of other colors?  Is there a color table guide/cheat sheet somewhere?  I’m just not sure what 125 is … Is there some way to take a hex color and convert into a number that setaf can use?


I'm trying to create a floatingactionbutton with a listener to open a new view.  public class ConnectionMenu extends AppCompatActivity { ConnectionManager conn = new ConnectionManager(); CredentialManager cred = new CredentialManager(); FloatingActionButton fab; @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_connection_menu);     Toolbar toolbar = findViewById(R.id.toolbar);     setSupportActionBar(toolbar);     final EditText field1 = findViewById(R.id.editText);     final EditText field2 = findViewById(R.id.editText2);     final EditText field3 = findViewById(R.id.editText3);      FloatingActionButton fab = findViewById(R.id.fab);     Button button = findViewById(R.id.button2);     final Spinner spinner = findViewById(R.id.spinner);     final Intent intent = new Intent(this, CredentialMenu.class);     Object[] credentials = cred.getAllnames();      ArrayAdapter<Object> adapter = new ArrayAdapter<>(this,             android.R.layout.simple_spinner_item, R.id.spinner, credentials);     spinner.setAdapter(adapter);     fab.setOnClickListener(new View.OnClickListener() { //fails here!!!!         @Override         public void onClick(View view) {             startActivity(intent);         }   But the exception in the title is throwed. The structure of my xml files is:  activity_connection_menu.xml:  <?xml version="1.0" encoding="utf-8"?><android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="net.ddns.andrewnetwork.raspberrymonitor.View.ConnectionMenu">  <android.support.design.widget.AppBarLayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:theme="@style/AppTheme.AppBarOverlay">      <android.support.v7.widget.Toolbar         android:id="@+id/toolbar"         android:layout_width="match_parent"         android:layout_height="?attr/actionBarSize"         android:background="?attr/colorPrimary"         app:popupTheme="@style/AppTheme.PopupOverlay" />  </android.support.design.widget.AppBarLayout>  <include layout="@layout/content_connection_menu" />     content_connection_menu.xml  ...         <android.support.design.widget.FloatingActionButton             android:id="@+id/fab"             android:layout_width="match_parent"             android:layout_height="84dp"             android:layout_marginLeft="32dp"             android:layout_marginStart="32dp"             android:layout_weight="1"             android:clickable="true"             android:focusable="true"             app:backgroundTint="@color/colorPrimaryDark"             app:srcCompat="@android:drawable/ic_menu_add" />      </LinearLayout>      <Button         android:id="@+id/button2"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_marginEnd="40dp"         android:layout_marginStart="40dp"         android:layout_marginTop="40dp"         android:layout_weight="1"         android:text="@string/button1"         app:layout_constraintEnd_toEndOf="parent"         tools:layout_editor_absoluteY="206dp" />  </LinearLayout>     Seems like that the fab variable is instantiated but actually null in its contents. Any ideas?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have a simple interval which subtracts 0.1 each time around. But the number sequence goes weird after 3 iterations... this is what i have:   function transition_opacity(div_id,opacity){     opacity = 1; //temporary test     var IntervId = setInterval(process_transition,30);      function process_transition(){         console.log(opacity); //check the value         opacity = opacity -  0.1         div_id.style.opacity = opacity;     if(opacity < 0.0){             rmv_div(div_id);             clear();         }     }      function clear(){          clearInterval(IntervId);     } }   The console log shows this for the value of opacity:  1 0.9  0.8  0.7000000000000001 0.6000000000000001 0.5000000000000001 0.40000000000000013  0.30000000000000016 0.20000000000000015 0.10000000000000014 1.3877787807814457e-16    Why is it doing this crazy number sequence =/ doesn't seem to make sense to me... it works fine up to 0.8

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


What is the best guide to root the "Nexus 5" 4.4 Kitkat version? There seem to be so many guides and I'm not sure which one is the easiest and quickest to follow.  Also when rooted, where can I get custom roms?   Also what if I wanted to flash it back to Stock 5.2 lollipop, where do I get that?

This is a common question asked by those who want to root their phones. How exactly do I root my Android device? Are there risks involved?


my company is considering switching from using Bing Maps to an open data source mapping option like MapBox. We are also looking into options like Google Maps.   My only question is what the quality of data is like for OpenStreetMaps. Its hard to jump around maps and check for this. I have done a little of this and have seen places where it appears OpenStreetMaps has better data and vice versa, however this is a very small sample.   Does anyone have a good general view of how the data quality compares between OpenStreetMaps and options like Google or Nokia?  Thanks

What are the sources of excellent geo-location data as possessed by Google Maps ?   I am wondering that, even with large amount of volunteer work involved, why is OSM data not comparable to theirs in terms of quality ?


The image that I'm inserting is basically text so I want the image in the same line as of the text. The problem currently is that the image is going slightly higher than that of the text and isn't coming on the same line. Here is the code snippet: <Typography component="h1"  variant="h4">         Welcome to  </Typography>  Here is the snapshot for further reference:

Why won't vertical-align: middle work?  And yet, vertical-align: top does work.   span{   vertical-align: middle; }
      Doesn't work.


I want to echo some unique string to a file. Sample code like bellow:  { echo "    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined" echo "    LogFormat "%h %l %u %t \"%r\" %>s %b" common" } >> file.conf  When i run it, file.conf become seperate in to 2 file. How i can echo it with a correct way?  Thank You

I'm having trouble with escaping characters in bash. I'd like to escape single and double quotes while running a command under a different user. For the purposes of this question let's say I want to echo the following on the screen:  'single quote phrase' "double quote phrase"   How can I escape all the special chars, if I also need to switch to a different user:  sudo su USER -c "echo \"'single quote phrase' \"double quote phrase\"\""   Of course, this doesn't produce the right result.


I am traveling from Prague to Boston and have a layover in London to change my flight and duration between flight is 2 hours. I hold a valid H1b visa of USA. Am I required to obtain a transit visa?

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


The goal is to prove directly that $\mathfrak{sl}(n,\Bbb C)$ is a simple Lie algebra for $n \ge 2$  So far I'm trying to think of ways to show that there are no non-trivial ideals (definition of simple) for $\mathfrak{sl}(n,\Bbb C)$, where $\mathfrak{sl}(n,\Bbb C)$ is the collection of all matrices which have trace $= 0$.  I'm still trying to wrap my head around Lie algebras, so any help is appreciated.

We defined a Lie algebra to be simple, if it has no proper Lie ideals and is not $k$ (the ground field). We have the proposition that $\mathfrak{sl}_n(\mathbb{R})$ and $\mathfrak{sl}_n(\mathbb{C})$ are simple $\mathbb{R}$-Lie algebras, and $\mathfrak{sl}_n(\mathbb{C})$ is also simple as a $\mathbb{C}$-Lie algebra. We have shown the proposition for the case $n=2$ using an $\mathfrak{sl}_2$-triple.  How would I show the statement for general $n \in \mathbb{N}$?  I suspect there's a way to use induction, but don't see how that would work. Also, I have no idea how I would generalize and apply the idea with the $\mathfrak{sl}_2$-triple to higher dimensions. I can't even just do the case $n=3$. How do I generalize?


On our , for instance, there are currently less than 20 users with sufficient reputation to close questions.  Since the beta went public, there have been several new users and questions - which is of course mostly a good thing! - but some of them don't appear to have paid much attention to any of the Area 51 definition questions, the meta chatter, or the proposed FAQ thread, and are asking questions that have almost unanimously been declared off-topic.  Unfortunately, with so few people able to "moderate", compared to the shortened duration for questions staying on the front page, it's almost impossible to get a question closed because too few people actually see it.  And obviously none of us have the "closed questions" link because that requires a much higher rep, even in beta.  I propose that close votes take a full 5 days to age away during public betas until there are no fewer than 50 users with close privileges.  It's unreasonable to expect just 15 people to all visit the site and open the same questions within a 48-hour period when questions no longer stay on the front page that long.  However, these questions do get bumped, so if the aging period were temporarily extended, then I think it would help a great deal in letting the community work its magic.  Alternatively, you could provide access to the close votes link in the 10k tools.  With such a small number of community "moderators", I don't see how it could hurt, and it would make it easier for people who visit fewer than 10 times a day to find close candidates.  Thoughts?  P.S. I'm hearing that the aging period is actually 4 days, and that's what it says in the FAQ, but I'm almost positive I've seen one or two votes age on questions that are only 2 days old.  If it turns out I'm hallucinating, I'll just delete the question, but regardless, we need to do something to make it easier to close questions during the betas.

I nominated  to be closed as a dup. I see that two other people upvoted my comment, so they might have voted to close it as well. Now, we didn't gather enough votes, and all close votes expired ... and I can't re-vote to close. What is the motivation behind expiring close votes ... especially for close-as-duplicate? Update: Please take into consideration:  Beta Stack Exchange sites have a smaller community, and fewer people with voting privileges Closing as a duplicate is "usually the right thing" IMHO - much less controversial than closing as off topic. After a vote is reset, the original users can't vote again. On a small site, this makes it even harder to get a consensus of five votes.


I am working with a PostgreSQL/PostGIS (version 12.3/3.0.1) database and I am using QGIS (version 3.10) to visualize and work with my data. In the database I have two schemas:  schema for spatial data tables, e. g. gebaeude schema for documents, e. g. dokument, dok_gebaeude (without spatial information)  I set a m:n relation between gebaeude and dokument using the table dok_gebaeude. My tables are:  dokument: id, bezeichnung, dateityp, pfad dok_gebaeude: id, fk_dokument, fk_gebaeude --> fk_dokument references dokument(id) and fk_gebaeude references gebaeude(id) gebaeude: id, geom, nummer, nutzung  In QGIS I loaded the relationship with the >project properties>relation manager and I can use it to connect documents (stored in table dokument) with gebaeude-objects. All work fine. BUT... When I open a new QGIS project, I always have to discover and add the relationship again in my >project properties>relation manager. In addition, I have to readjust each time the attribute form of the table gebaeude (I´m using the drag and drop designer and implement there the m:n relationship). Is there any possibility to automatically discover and add the relationship by starting a QGIS project?

I am working with a PostgreSQL/PostGIS (version 12.3/3.0.1) database and I am using QGIS (version 3.10) to visualize and work with my data. In the database I have two schemas:  schema for spatial data tables, e. g. gebaeude schema for documents, e. g. dokument, dok_gebaeude (without spatial information)  I set a m:n relation between gebaeude and dokument using the table dok_gebaeude. My tables are:  dokument: id, bezeichnung, dateityp, pfad  dok_gebaeude: id, fk_dokument, fk_gebaeude --> fk_dokument references dokument(id) and fk_gebaeude references gebaeude(id)  gebaeude: id, geom, nummer, nutzung   In QGIS I loaded the relationship with the project properties>relation manager and I can use it to connect documents (stored in table dokument) with gebaeude-objects. All work fine. BUT... In QGIS I only need the table gebaeude and I don´t want to load the tables dokument and dok_gebaeude in my layers (the latter are only technical tables). Unfortunately it is neccessary to load all three tables (dokument, gebaeude and dok_gebaeude) in my layers in QGIS, otherwise I am not able to add the relationship in my project properties>relations. Is there any possibility to hide or remove or not even load tables (dokument and dok_gebaeude) in my layertree without losing the relationsships?


Trying to better understand syntax vs semantics (structure vs meaning) in logic and metalogic.   I am using this as my reference point (and the example(s) below on this link):   e.g. let's say we have the connectives/operators:  $\Omega = \Omega_0 \cup \Omega_1 \cup \Omega_2 = \{T, F\} \cup \{\lnot\} \cup \{\to\}$  And the following rule of inference (modus ponens):  $P, P \to Q \vdash Q$  And the following axioms (Jan Łukasiewicz system, picking these arbitrarily):  I. $(p \to (q \to p))$  II. $((p \to (q \to r)) \to ((p \to q) \to (p \to r)))$  III. $((\lnot p \to \lnot q) \to (q \to  p))$  Does this fully describe the entire logical system, or only in terms of syntax? Do the semantics follow or do we have to impose those on top of all this? Is imposing semantics a metalogical level concept?  To my current understanding, we'd use truth tables to define various operators and such to give semantic meaning but are these optional / more of a convenience, or are they necessary?   Are truth tables still metalogical?   What about other definitions, like introducing operators such as $\land$, $\lor$, etc, are these still metalogical or would they need to be embedded in $\Omega$ up front?  For example, how do we use all this to describe how $\lnot$ and $\to$ work? i.e. showing that:  $\lnot T = F$  $\lnot F = T$  $F \to F = T$  $F \to T = T$  $T \to F = F$  $T \to T = T$  Or law of excluded middle:  $p \lor \lnot p = T$ (after defining $\land$ and $\lor$, etc)  Do we explicitly define these with truth tables, or derive them from the axioms and inferences somehow? How do the axioms and rules of inference play with each other here and allow us to ultimately go from something involving $\vdash$ to something with $=$ or $\to$?  Trying to understand how we start off with a system and start unrolling a logical system as we might normally use it.

I've read in some textbooks that $\vdash$ and $\vDash$ are symbols present only in metalanguage. From this, I infer that their use in object language is unacceptable.  I would like to know why. Can't we define them as relation symbols in a structure? Or introduce them in statements for the sake of formal proofs?


I tried following  guide, but when I ran sudo modprobe -v 8812au I received the error modprobe: FATAL: Module 8812au not found in directory /lib/modules/5.4.0-72-generic I also found this same guide in an answer to a question on how to get this to work. I came across  thread where the OP was having the same issue, but it looks like he never received any replies. Does anyone have any ideas? I tried rebooting and doing everything again and the same thing happened. My other WiFi adapter that is actually meant for Linux and I believe uses Broadcom drivers works perfectly fine. Edit: Came across  guide, the solution is in the comments. I had to build from source, everything appears to be working now.

I did the following in a terminal to get a AC1200 Linksys Wireless adapter to work on my Ubuntu 19.10 install:  sudo apt-get install linux-headers-$(uname -r) linux-headers-generic build-essential git git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux cd rtl8812AU_8821AU_linux make sudo make install   This process went through without errors and install was completed.  However, my wireless USB adapter still doesn't work. I ran lsusb in terminal and my wireless adapter was listed as  Bus 002 Device 004: ID 13b1:003f Linksys WUSB6300 802.11a/b/g/n/ac Wireless Adapter [Realtek RTL8812AU]   I then ran the following, and it simply returned the command line prompt  modinfo 8812au | egrep -i 'versi|filen|003f' sudo modprobe -v 8812au iwconfig iwlist chan   When I opened my network setting for WiFi, I received the following:     No WiFi Adapter found   Make sure you have a wifi adapter plugged in and turned on   I also tried to get it to work by installing ndiswrapper, but that didn't work either.  I have researched this and have tried numerous things I found, but nothing seems to work. I know this has been answered before, but the answers all indicate the above procedure.  Any help is appreciated as I am new to Ubuntu, but have run Red Hat linux prior to its shifting to Fedora.


In this scene from Harry Potter and the Deathly Hallows,  Voldemort seemingly confirms Snape's information by using Leglimency.  “My Lord, the Order of the Phoenix intends to move Harry Potter from his current place of safety on Saturday next, at nightfall.” The interest around the table sharpened palpably: Some stiffened, others fidgeted, all gazing at Snape and Voldemort. “Saturday... at nightfall,” repeated Voldemort. His red eyes fastened upon Snape’s black ones with such intensity that some of the watchers looked away, apparently fearful that they themselves would be scorched by the ferocity of the gaze. Snape, however, looked calmly back into Voldemort’s face and, after a moment or two, Voldemort’s lipless mouth curved into something like a smile. “Good. Very good. And this information comes —” “— from the source we discussed,” said Snape.  But how did Voldemort believe Snape on this one? Case 1: He read Snape's mind and Snape didn't block him. This would be quite dangerous for Snape, as it would reveal his role as a double double agent. So this is definitely not the case. Case 2: He tried to read Snape's mind and Snape did block him. This would make Voldemort quite suspicious, as he would wonder what information Snape wishes to hide from him. So that wouldn't work either. Then how did Snape manage to hide the information from Voldemort, while simultaneously revealing information about the departure date?

We know Severus Snape was "an accomplished Occlumens." We also see that Voldemort, who was a powerful Legilimens, was unable to detect when Snape was lying to him. Does this mean that Voldemort could not detect when he was being lied to because of Snape's Occlumency? Would he know that Severus was protecting his thoughts from being read, had Voldemort tried Legilimency on him?


I'm new to doing bike stuff, but I want to install drop bars on my single speed 2012 Trek Earl, how would I go about doing so? What things would I need to take into account before getting started?

I have a two-and-a-half year old  (with a road-bike-like frame and thin tires; it's somewhere in the loosely-defined "hybrid" range) that I use to commute to work, twenty-five miles round-trip, once or twice a week. The bike has straight handlebars, and having gotten used to the idea of commuting via bike, I'm interested in upgrading to drop handlebars. It looks like I'd need new break/shift levers to go with the handlebars; the whole upgrade looks like it'd run a couple hundred dollars. This is a sizable fraction of the original cost of the bike, which leads me to wonder if I'm better off saving my money for a new bike that's a little better adapted to my use.  Is upgrading my bike's handlebars a reasonable investment?


I wanted to set an onmarkerclicklistener for the map, but I get:   "Attempttoinvokevirtualmethod'voidcom.mapbox.mapboxsdk.maps.MapboxMap.setOnMarkerClickListener(com.mapbox.mapboxsdk.maps.MapboxMap$OnMarkerClickListener)' on a null object reference"   I guess this is because I haven't initialized the map, but I dont know how to.  Anyone knows? Thanks!

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


In general i see there are so many vdd and vss pins in micro controllers.Is there any specific reason for that? why cannot we have a single vdd and vss pin?

What is the reason that most of ICs (e.g. MCU) has multiple (A/D)GND and (A)VCC pins?   If it is to increase performance of an IC, how does it help to performance? or is it easier for the IC designer to connect some pins externally?    some footprint of ICs have a GND connection under the case, how does it help? Would it improve performance of an IC if I draw a GND under the case even if it is not required?


Being familiar with the Developer console.. Can Any one tell me how to clear the test run results area in the developer console  This is the section that I want to clear...

I need to test a bunch of test classes. The test runs are collecting in a huge list so i do not get an overview anymore. Is there any way to clear this list?    Debug -> Clear seems not to work with this view.    And under Test i can't find any useful option for that:    Any ideas?


I have been reading a book called "Head First Design Patterns-A brain friendly guide" by Eric Freeman & Elizabeth Robson. All of their examples are in Java.   On page 15, what they have done is:   In a duck class, two variables of interface type are declared. Please see the image.     As a newbie in Java, I have always thought the way to utilize interface is via "implement", but this example surely got me thinking.   May I ask if it is a common practice to use interface this way? I could have completely missed something here.  Thank you

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


I am trying to learn Time complexity of a programs.  I studied many blogs but, Each one is trying to explain different.  Can any one explain me clearly with programs as example.  Thanks in advance.

I'd prefer as little formal definition as possible and simple mathematics.


I need to forward to another JSP page based on so-called "action" parameters.   I have the following piece of code from servlet  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {     // TODO Auto-generated method stub      String action=request.getParameter("action");      if(action=="login"){          RequestDispatcher requestDispatcher = getServletContext().getRequestDispatcher("/login.jsp");         requestDispatcher.forward(request, response);     }; }   I have a JSP page "login.jsp". When I type the following url  http://localhost:8080/AgileScrumBoard/MainController?action=login   the browser doesn't forward me to the login.jsp page. What might be an issue?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Let $F/K$ be a field extension and $a\in F$ such that $[K(a):K]$ is odd. Prove that $K\left(a\right)=K\left(a^{2}\right)$ and give counterexample if $[K(a):K]$ is even.

I have a question about simple field extensions.  For a field $F$, if $[F(a):F]$ is odd, then why is $F(a)=F(a^2)$?


Each Chocolate Frog comes with one collectable illustrated wizard card (very cool and not dorky at all, honest). There are equal odds of each card being in a pack (i.e., they have all been produced and distributed evenly). How many packs must we buy in order to have an 80% chance of having obtained all 12 cards? How about 90%? Thanks.

I'm trying to solve the well known Coupon Collector's Problem by explicitly finding the probability distribution (so far all the methods I read involve using some sort of trick). However, I'm not having much luck getting anywhere as combinatorics is not something I'm particularly good at.   The Coupon Collector's Problem is stated as:  There are $m$ different kinds of coupons to be collected from boxes. Assuming each type of coupon is equally likely to be found per box, what's the expected amount of boxes one has to buy to collect all types of coupons?  What I'm attempting:  Let $N$ be the random variable associated with the number of boxes one has to buy to find all coupons. Then $P(N=n)=\frac{|A_n|}{|\Omega _n|}$, where $A_n$ is the set of all outcomes such that all types of coupons are observed in $n$ buys, and $\Omega _n$ is the set of all the possible outcomes in $n$ buys. I think $|\Omega _n| = m^n$, but I'm not even sure about that anymore, as all my attempts so far led to garbage probabilities that either diverged or didn't sum up to 1.


So I am trying to encode database selection, wich is done in php, in utf-8 but then it doesn't show C with colun. Like here:     Then I tried windows-1250 wich shows the coluns but it breaks nicknames of players.  Like here:   But I have red that UTF-8 should support czech letters, so what is going on?
      <?php header("Content-Type: text/html; charset=UTF-8");  // Doplňovačky $server = "xxxx"; $jmeno = "xxxx"; $heslo = "xxxx"; $dbnazev = "xxxx"; $pripoj = new mysqli($server, $jmeno, $heslo, $dbnazev);  // Kontrola připojení if ($pripoj->connect_error) {     die("Chyba pripojeni: " . $pripoj->connect_error); }  // Výtažek z databáze $sql = "SELECT name, time, server FROM redirect_follow"; $vysledek = $pripoj->query($sql);  // Podmínka zjišťující zda-li se v databázi nacházejí data if ($vysledek->num_rows > 0) {     echo "

Nick	čas	Server
";      // Jednotlivé řádky s daty     while($radek = $vysledek->fetch_assoc()) {         echo "
".              $radek["name"]. "	".              $radek["time"]. "	" .              $radek["server"] . "
";     }  // Pokud v databázi nejsou data, vyhlásí chybu     echo "
"; } else {     echo "Zadny vysledek"; }  $pripoj->close(); ?>

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


Which of the following would be correct:   The User Name and/or Password are incorrect. The User Name and/or Password is incorrect.   Or neither?  Thanks!

If the subject of a sentence is separated by "and/or", should the verb be pluralized, as with "and", or agree with the rightmost subject, as with "or"? For example:     His co-workers and/or his boss was at fault.   vs.     His co-workers and/or his boss were at fault.


Could someone please let me know how to find the MLE of $\theta$ when we have a random sample from pdf $N(\theta,\theta^2)$ and from pdf $N(\theta,\theta)$?   I found an old thread that referred to  book but the author does not provide the steps.  Thanks in advance!

$\newcommand{\nd}{\frac{n}{2}}$For an $n$-sample following a Normal$(\mu=\theta,\sigma^2=\theta)$, how do we find the mle?  I can find the root of the score function $$ \theta=\frac{1\pm\sqrt{1-4\frac{s}{n}}}{2},s=\sum x_i^2, $$ but I don't see which one is the maximum. I tried to substitute in the second derivative of the log-likelihood, without success.  For the likelihood, with $x=(x_1,x_2,\ldots,x_n)$, $$ f(x) = (2\pi)^{-n/2} \theta^{-n/2} \exp\left( -\frac{1}{2\theta}\sum(x_i-\theta)^2\right),  $$ then, with $s=\sum x_i^2$ and $t=\sum x_i$, $$ \ln f(x) = -\nd \ln(2\pi) -\nd\ln\theta-\frac{s}{2\theta}-t+\nd\theta, $$ so that $$ \partial_\theta \ln f(x) = -\nd\frac{1}{\theta}+\frac{s}{2\theta^2}+\nd,  $$ and the roots are given by $$ \theta^2-\theta+\frac{s}{n}=0. $$ Also, $$ \partial_{\theta,\theta} \ln f(x) = \nd \frac{1}{\theta^2} - \frac{s}{\theta^3}. $$


I wrote a javascript function to extend an object with a property(s) that follow this sort of notation: "a.b.c". The function works flawlessly (so far) but I couldn't quite understand after looking back over my code why it worked. I'm assuming there is a javascript scope explanation, maybe the for loop? but I was wondering if anyone could explain this to me properly.  var extend = (target, targetProperty, value) => {   var targetProperties = targetProperty.split(".");    for (var i = 0, len = targetProperties.length; i < len; i++) {     var part = targetProperties[i];      if (i == len - 1) {       target[part] = value;       break;     }      if (!target[part]) {       target[part] = {};     }      target = target[part];   } }  var myObject = {myProperty: "Hello"};  console.log(myObject);  extend(myObject, "a.b.c", "World");  console.log(myObject);   It is pretty straight forward, I understand that "target" is coming in by reference because it is an object, the part that I don't understand is how on the line target = target[part]; the original object being passed in is not completely overwritten by the newly created empty object on this line target[part] = {};.  Thanks!

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


Is there a mechanic to let me limit SSH and telnet logins to the root account based on IP address? I have 3 nets used for different things locally all in the 192.168.x ranges, I need to login from those and banned from anywhere else.  I know having root active is frowned on... but like a bad admin I live in my root account.

I have a monitoring server that requires the SSH connection details of a non-sudo user account of each box it monitors. Is there a way that I can configure a specific user account such that it can only be logged into from a specific IP (or better yet hostname)? I do not want to restrict the ability of other users on the server to be able to connect from other addresses (otherwise I'd just use a firewall), or .


I've been working on this for hours but I still can't get my methods to work no matter how many times I look over bitwise functions. (Switching it to just pos throws an error). Bits() = default;  Bits(IType n) {      bits = n;  }  void set(int pos) {      (bits |= 1ULL << (pos-1)); }  void reset(int pos) {      // Resets (makes zero) the bit at position pos     bits  &= ~(1ULL << (pos-1)); }   For some reason it seems to be filling out the bit with the entire long.

How do you set, clear, and toggle a bit?


Does Early 2015 MacBook Pro output 4K 3840 via Mini DisplayPort to DisplayPort? I seem to get only HD max option on YouTube videos.  I have a Samsung U32J590U 31.5" 4K UHD monitor. If not, do I have to get a real Thunderbolt cable or is HDMI-to-HDMI the answer?

How do I find out the number, type, resolution & refresh rate of additional monitors I can attach to my MacBook or MacBook Pro?  This is an attempt at a canonical QA, as per the Meta QA -   to try prevent the myriad "same but different" questions we get on every possible combination of computers, cable & monitors There are perfectly good resources out there that Ask Different should not have to duplicate the efforts of.


I have a list of names and using random.choice(), I am able to get a random element from the list. Now I am trying to figure out at what index that given element sits in the list. This is what I have so far: import random  x = ['Jess','Jack','Mary','Sophia','Karen','Addison','Joseph','Eric','Ilona','Jason'] y = random.choice(x) print(y)

Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index (1) in Python?