How can I remove excess values from an ArrayList but keep one of the original value?

For example:  ArrayList<Integer> a = new ArrayList<Integer>();  while(a.size() < 50){         a.add(1);         a.add(2);         a.add(9);     }     System.out.println(a);   I would like to remove all the excess 1's, 2's, and 9's, but keep one of each.  Not cleared: [1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9]  Cleared: [1, 2, 9]  Ideally I would like this to work for any x value that occurs any n number of times in the ArrayList.  My partial solution just returns whether or not a value occurs more than once (true if it occurs more than once, false if it doesn't)  public static boolean occ(ArrayList<Integer> l, int s) {      int n = 0;     boolean t = false;      for (int p : l) {         if (p == s) {             n++;         }     }      if (n > 1) {         t = true;     }      return t; }   Method implementation:  occ(ArrayList, Selected Int Value to be Checked);  If I change to a HashSet or Set, would I be able to implement the ArrayList methods clear() and size()?


Discrete math statement $\rightarrow$ plain English. $\left(Longer\right)$

I found this one more challenging, I think the length of it confused me the most.    Given Statement: $\forall x \in \Bbb N \left[\left(\exists y \in \Bbb N \left(2 \le y \land y \lt x \land y \mid x \right)\right) \to \left(\exists z \in \Bbb N \left(2 \le z \land z \le \sqrt x \land z \mid x\right)\right)\right]$  So far I have written it as: For all $x$ in the natural numbers and there exists $y$ for all natural numbers where $z$ is smaller or equal to $y$ if and only if $y$ is smaller than $x$ if and only if $y$ is a divisible of $x$ then, $\cdot \cdot \cdot$  I only wrote it up to the $\rightarrow$, but not sure if it makes sense and furthermore if it's correct. Thus, can I continue like this for the next part.  Any edits of my existing statement and any help in converting to plain English is welcomed. Thank you in advance.


Is a batsman out when any of his things slip away and hit the stumps?

Is a batsman out if his helmet, bat or any of his equipment slip away from him and hit the stumps?It always confuses me


Cannot logn on virtual terminal - return repeating?

My Ubuntu 18.04.2 system is working OK except for the following problem:  I cannot seem to be able to login on any of the virtual terminals (Ctrl+Alt+F1 to F6. Specifically, I can type my username fine, and the keyboard works without a problem, no unusual behaviour, until I press Return (or Enter on the keypad).  At that point, the password prompt appears but immediately it is as if Return is pressed again, so entering a blank password and giving Login incorrect. The login prompt reappears but again it is as if Return is immediately pressed, again giving Login incorrect. The repeats a few more times until the screen clears and the login prompt shows again. Now Return does not keep repeating.  Any ideas? The Return key is working no problem in graphical mode.


LightDM and GDM login loop. Ubuntu 15.04 Gnome 3

At first the GDM worked just fine but all of a sudden I lost the ability to login. I can still get to my desktop using startx (sound doesn't seem to work when I do that but it might be a by-product of having to use root privileges to get startx to run.) There doesn't seem to be anything especially incriminating in any of the error logs or journalctl except for   Mai 10 03:56:38 curtis-UX301LAA systemd[1]: Started Light Display Manager. Mai 10 03:56:38 curtis-UX301LAA systemd[1]: Started ACPI event daemon. Mai 10 03:56:38 curtis-UX301LAA systemd[1]: Starting ACPI event daemon... Mai 10 03:56:38 curtis-UX301LAA systemd[1]: Started Run Click system-level hooks. Mai 10 03:56:38 curtis-UX301LAA acpid[1295]: starting up with netlink and the input layer Mai 10 03:56:38 curtis-UX301LAA acpid[1295]: 9 rules loaded Mai 10 03:56:38 curtis-UX301LAA acpid[1295]: waiting for events: event logging is off Mai 10 03:56:38 curtis-UX301LAA acpid[1295]: client connected from 1288[0:0] Mai 10 03:56:38 curtis-UX301LAA acpid[1295]: 1 client rule loaded Mai 10 03:56:38 curtis-UX301LAA systemd[1]: Received SIGRTMIN+21 from PID 384 (plymouthd).   I know this is really vague but if someone could point me towards where to start finding potential errors I'm sure I'd be able to make progress on this.  Q:What is the best way going about debugging this?  P.S. The issue isn't with permissions and I've uninstalled-reinstalled both GDM and lightDM many times. The only thing I can think of is there is something up with my lightdm config file but all I have in there is autologin and user-session=gnome. Also there is nothing in .xsession-error. This is what makes my issue different from .   Updates: It seems that the sessions are getting correctly started and actually persist (at least as far as I can tell by looking at the journalctl output.) There are no errors getting returned from X but I do see dbus errors scattered a little bit everywhere.


Can momentum be conserved in a perfectly elastic collision?

I am taking for granted that when we say that something is conserved it is understood 'in its full integrity'.    Energy is represented by a scalar J,  and is conserved in elastic collision.  momentum is the product of a number (of Kg) by velocity which is a vector, and therefore has a direction: $p = m * v$. (In circular motion we say that speed is constant but velocity is constantly changing).   In an elastic collision if a ball A (m = 1) with v = p = +8 in the x axis (E = 32) hits a ball B at rest (M =3) , B will proceed ( p = 4 *3 = +12, E = 24)  and A will bounce in the opposite direction (p = v = -4, E = 8). We conclude that: +12 -4 = +8, momentum is conserved (and also energy: E = 8 + 24 = 32 J)  If a perfectly elastic ball is thrown against a wall energy J is conserved, $E-i = E_f$ the value of the speed is unchanged, but the direction of the vector is reversed.  I am asking: the momentum of what is conserved? if it is the momentum of the system this  is not true in the first case, if it is the momentum of the single balls this is not true in the second case.  Language of science  must be precise, I hope you will not consider this as hair-splitting, but I ask: is there a general definition of 'conserved' valid for all instances? why a broad/permissive interpretation of the principle in the case of momentum? Or, most likely, where did I go wrong?  EDIT :     This does mean that the wall contains a momentum of 2mv (for mass m   and velocity v). But note that since the mass of the wall is   incredible compared to the ball, the velocity is notably   imperceptible!   If the momentum of the wall were to be 2mv, the energy of the bouncing ball should be impercetibly less but yet less: $E - \epsilon < E$ and the Energy of the ball would not be conserved. That means that a perfect elastic collision against a fixed body is not possible, in the sense that no body can have a CoR = 1. right?


Proving $ C = D $ from $ A \triangle C = A \triangle D$

I have been working on one part of the proof where my aim is to show that $C =  D$. I have been able to prove that $ A \triangle C = A \triangle D$.  Is it reasonable to conclude $ C = D $ from $ A \triangle C = A \triangle D$ ?


Do I use mens' or men's if I wanted to say:  The swords of the men gleamed in the light.  Is it  The men's swords gleamed in the light.  or  The mens' swords gleamed in the light.


Is "must" ever grammatical as a past tense verb?

I have seen uses of must that appear to be in the simple past tense. Sometimes these seem grammatical, but sometimes not. Examples that help illustrate my confusion:     He knew he must go to New York - sounds fine to me.      He went to New York because he must - sounds questionable.      Because he must go to New York, he bought plane tickets - sounds completely ungrammatical.      He must go to New York - grammatical, but with no other verbs to provide context, can't interpret this as being past-tense.   My question: is this past-tense use of must ever acceptable? Is it only acceptable in certain contexts - if so, what are those contexts and why?  (Note - I'm not looking for had to. Have is a different verb, so had to expresses the same meaning as the past tense of must, but it itself is not the past tense of must.)


A grace period of one day to award the bounty after expiration (without remaining featured, of course)

Since  is not really intended behaviour apparently, I propose a period of 24 hours after the bounty has expired during which the question will not be on the featured tab but the promoter can still manually award the bounty. The "cost" of this would be that no new bounty could be set up until the old one were awarded.  Similar to , which got closed as a duplicate without duplicate link... (Well, according to Robert's comment there, it's , to which he replied with basically what I am proposing here, but an answer is not a feature-request...)


If Java is pass-by-value, then why can we change the properties of objects in methods?

This gif was retrieved from     Maybe I'm terribly misunderstanding this, but please bear with me.  According to my understanding, when we define a variable in java, we are essentially creating a pointer to that object that is created. i.e.  Object objPointer = new Object();   Here objPointer is reference to the Object that was created, not the object itself. And when we use this object as an argument in a method:  void foo(Object newPointer){     //newPointer points to a copy of the Object objPointer pointed to. }  foo(objPointer);   The formal argument newPointer is pointer to a copy of the value of the object that is passed as an argument. This is why swap methods don't work in java.   But my question is this: If the formal argument only points to a copy of the original object, then why can we change the values of the properties of that object? i.e.  class Object{    int var = 0; //default value of 0    void setVar(int newValue){       this.var = newValue;    } }  void foo(Object newPointer){     newPointer.setVar(1);  }  Object objPointer = new Object(); //The Object objPointer points to has a var value of 0 as default.  foo(objPointer);  /*        After foo is called, the var value of objPointer has changed to 1      although the setVar method should only change the value of var for the copy       of that object that newPointer points to. */   I hope what I'm asking makes sense, the gif I found kind of illustrates what I'm saying: How are the properties of the cup Object changed, if fillCup only changes the properties of the copy?


How to report a money laundering scam that is recruiting on a college campus via social media?

I know, I know; "Is this a scam?", yes, I had to ask.  As of recent, I have heard 3 separate people in conversation on my campus mention a "sales job" they undertook after being contacted on LinkedIn where they "manage accounts" by receiving checks from customers, and then wire the balance of that check to another account minus a 5% take they get to keep.  To me, obviously, this screams "money laundering"; they claim this is the only work they do, that it is legitimate because they are sent tax forms, and that it is legitimate because they have been paid. One of them claimed they've been involved with it for more than two months, and another attempted to smugly defend himself against two academic administrators who told him it was a poor idea.  I've never heard of these scams operating and finding victims through LinkedIn, so that is what makes me 1% skeptic that this is some sort of legitimate business, and I don't know the people I've talked to well enough to even know their name, so I'm unsure what to do about this.  How would I go about reporting this? I've never had any interaction with the scam myself, but I don't like the idea of this spreading to people I know if it is a large networked scam that is either stealing money from students or making them complicit in money laundering.  I don't believe this is a duplicate because apparently these students are given full account details, and it appears to be a large concerted effort to pose as a legitimate business through social media attempting to recruit "salespeople" who redirect transactions over long periods of time. From what I understand, students give their account details, possibly just a routing number, and redirect the transactions and get to keep a cut; the scammers pretend this is a commission, and apparently get them to pay taxes on it (maybe they don't want to go down like Al Capone).


Running my application with command line args from IDE

I am working on a Visual C++ application that works only if command line arguments are passed to it. Since I have more kind of tests and arguments to pass to my application, passing them by the Project -> Options -> Arguments is not a good approach. I am currently looking for some kind of Visual Studio extension that allows me to run my application with arguments right from Visual Studio.


I wanted to recreate something like this:    And then I would use it for social medias and external sites :) This is what I could come up with:    As you can see, there are two problems here:   The picture doesn't fit the div. The text isn't in the middle.    I thought if I could align the text to the center, the picture would automatically fit as well, but I can't seem to be able to do it.   Here's the code I wrote:    .child {   height: 250px;   margin: 20px; }  .external-links {   display: table-cell;   background: #ccc;   vertical-align: middle;   text-align: center;   border-radius: 32px;   color: black;   text-decoration: none;   padding: 1px; }
             github                twitter                stackoverflow
     I thought the two lines of vertical-align: middle; & text-align: center; would center the text, but it doesn't.


Pythonic way to iterate over multiple lists in a for loop?

This seems pretty simple, but I haven't found a way to do it.  I have three lists, a, b, and c.  I want to iterate over all of them as if their elements altogether form one big list.  I can think of a few ways to do this, but nothing very smooth or "pythonic".  I expected the splat operator to work:  for e in (*a, *b, *c):    # do stuff with e   but that gives a syntax error.  Any ideas?


I do a two sample comparison with alpha = 0.05. The p-value I get is 0.33. I know that we do not reject the null hypothesis because it greater than 0.05. My question is can I interpret that the 0.33 is the probability that my null hypothesis is true. Could I also say that the null hypothesis probability of being false is 0.67?


There are some strange directories appearing in /home (so far, maybe in other locations too).  These directories do not show up in ls but do with bash's tab autocomplete, when doing things like cd.  The exact name of this mystery directory is .directory.  ls and cd fail on these directories.  P.S. There was more than one in /media, but they seem to have disappeared now.  UPDATE: Output of ls -la /home:  total 12 drwxr-xr-x  3 root      root      4096 Jan  3 11:28 . drwxr-xr-x 23 root      root      4096 Jan  3 11:32 .. drwxr-xr-x 25 bharadwaj bharadwaj 4096 Jan  8 22:58 bharadwaj lrwxrwxrwx  1 root      root        44 Jan  3 11:13 .directory -> /etc/kubuntu-default-settings/directory-home


what is the difference between TRY....CATCH and TRY.....Finally?

difference between try...catch and try....finally ? in asp.net(C#)  like when i want to catch error like 1/0 then i put code in try block and put exception object in catch block like response.write("ERROR:"+ ex.Message) but advisors told me that it isn't a good practice to put catch always, it absorbs error without notifying ????? ehhhhh ? but it did via ex.Message , so why ?  and what does try....finally do ? i know that it is used to release resources but of what use is TRY if exception can't be catched ?


Prove $I$ $\in$ $\mathbb{Z}[x]$ s.t. $I=\{f(x)\mid f(0) \text{ is even}\}$ is a maximal ideal, and find the number of elements in $\mathbb{Z}[x]/I$

I have already shown (in a previous question) that $I=\langle x,2\rangle$, and that I is a prime ideal, and I believe that allows me to show that $\mathbb{Z}[x]/I$ is an integral domain, which if it is finite would allow me to conclude that $\mathbb{Z}[x]/I$ is a field, which would imply that I is a maximal ideal. But I don't know how to determine the number of elements in $\mathbb{Z}[x]/I$, and thus do not know how to determine whether or not it is finite.   Can someone tell me if this thinking is correct, and if so how to determine the number of elements in $\mathbb{Z}[x]/I$?   Note: we have not covered irreducibility in this course.


What does the "rc" stand for in /etc/rc.d?

Does anybody have an idea about the full form of rc.d in, for example, /etc/rc.d?  It contains scripts to used to control the starting, stopping and restarting of daemons. But what exactly is the meaning of rc here?


How to draw a quiver in latex like this?

How can I draw a quiver in latex? Even if a simple one like this:


From Sipser's Introduction to the Theory of Computation:     A slight problem arises because certain numbers, such as 0.1999... and 0.2000..., are equal even though their decimal representations are different.   Can someone explain? Because that's news to me.


Please explain to a beginner: what is metaphysics?

As I understand it, most or all of philosophy can be put into the three main branches of philosophy: Epistemology, Metaphysics, and Axiology.  A devotee of reason, I have great affinity for, and believe that I get the core nature of, Epistemlogy: the study of how claims of knowledge are justified, or of how we know things.  I also think I get the basic idea of Axiology: the study of values, from ethics/morals to art and beyond.  After looking up (or asking people) what the core of the study of Metaphysics is, and while the words I read or hear have meaning, some kind of "blind spot" has heretofore obstructed me from understanding basically Metaphysics's purpose. In black and white, pragmatic, and discrete terms: of what is Metaphysics the study?   I appreciate answers not to add another layer of vague and undefined confusion on top; for every explanation to this question simply makes me ask what the explanation even means! (Metaphysics asks "what is the nature of reality?", but the question makes absolutely no sense to me! I do not understand the meaning of: "The nature of reality is what it is." So what else can you say without mystifying?)  Can anyone explain the purpose of the study of Metaphysics to someone like me with a pragmatic, rational personality and approach? Every time I think I have found an answer, it turns out to be more Epistemology, to the point that I am starting to wonder if fully embracing reason results in the elimination of Metaphysics! Thanks.


Crediting sources one has found citations from

Suppose that I am doing a literature review on a topic, and I read paper A, which makes an interesting claim and references paper B as its source. Naturally, as paper B is then the primary source, I will look up B and possibly cite it in my own paper if it seems relevant. And suppose that it turns out that paper A says nothing else that's relevant for my topic, so I say nothing about paper A.  And this seems fine if I only discovered one citation from paper A. But if I find several useful citations in the same paper, it starts to feel like plagiarism if I just ruthlessly harvest it for citations without never citing itself.   Sometimes it's easy to work in a citation in such a case. For example, if it's a review paper I'm reading, I might be able to just write in my own paper something like:     Qwerty (2009) reviews a number of a results in this field, such as the finding that over 99% of the people who contract cancer wear shoes (Keyes 1999), that pink aliens from the sixteenth dimension dislike chocolate (Pinker 2001), ...   But often there isn't really any reasonable way to work in a citation, especially not if you wish the citation to make it clear that this is where you found useful sources from. I could include a footnote or a thanks in the acknowledgements, but I've never seen anyone do that for such a reason. Are there any rules of thumb regarding the correct etiquette in such situations?


How can gravitational waves be detected when spacetime bends the instruments?

Apologies for the naive question, hoping someone with a proper physics background can explain this in layman's terms (as opposed to the more detailed answers at )  If gravitational waves affect spacetime itself, how can we detect changes since the instruments themselves are bent?  For example- I imagine spacetime like a piece of celluloid film. It might be bent or rippled, but inside of the frame everything is still relatively the same- it only looks different from the outside. How is this analogy wrong? i.e. how could a bend in the celluloid be detected from "within" the frame (ok that gets a little weird- like as a character in the movie? but hopefully this demonstrates my confusion on the topic well enough to elicit clarification, hehe)   UPDATE: Seems it has to do with my confusion of lightwaves being a measurement of space rather than a measurement of time. Some helpful links are at  and


How can LaTeX insert math formula in text paragraph?

If I want to insert a math formula, usually just a math symbol, in text paragraph, LaTeX put the formula to the next line and put it in the middle of the line?   How can I just insert between text?


Wifi LED on laptop blinking when connected to wifi

Yesterday I installed ubuntu 20.04 on my laptop.I dont know many things in ubuntu.When i installed it I saw that wifi led is constantly blinking.I dont know what to do.Is this problem with my laptop or is this some kind of bug? How can I fix this? it is distracting me when working on laptop.When i was on windows I knew i was connected when led is blue and disconnected if led is orange.On linux it is constantly changing between these 2 colors.


My text defines the equation for the probability of getting exactly $k$ independent successes in an experiment of $n$ trials, with $p$ being the probability of the success event and $q$ being the probability of failure ($1-p$) is:  $b(k; n, p) = {n \choose k}(p)^k(q)^{n-k}$  The part to the right of the binomial coefficient makes sense to me intuitively. What I don't understand is why we're multiplying it all by $n \choose k$. Could someone please help clarify this for me?


I want to ask if this map of Beleriand (in the northwest of Middle-Earth) is correct. I think it isn't because Beleriand should've been sank, and you can clearly see that there is Beleriand above Eriador, but still this is the best full map I've found on the Internet.


90s (or earlier) book, stars blocked out from Earth by a veil set by aliens who may have feared humans

I've been desperately searching for a book I loved on every level that I read when I was at school (20 odd years ago).  I've asked the local librarians, Google, you name it I've looked (even thought of calling my old schools to see if they would have my library record).   The few bits of memory I have of this book are that it was set on an Earth where the stars were blocked out by some other interstellar race with a veil or bubble of some kind.  The main character feels that this veil/bubble may have been put in place due to their fear of what the human race was capable of and often makes references to personal nano-tech upgrades and quotes the dollar price. I think it was about a detective or a guy who was trying to look for someone/something and used these devices on a nano scale to find them.


I'm stuck at this "Windows Update Standalone Installer" can you help me continue the update?

I've been trying to get this to work for days on end. I've reset my computer, redownloaded this update KB2592687 and waited hours for it to update. Does anyone know a way I can get past the "windows Update Standalone Installer" portion of the process? And if you could be as detailed as humanly possible about it, i'd appreciate that a lot. Since most tutorials tend to not be very specific with how I do everything and where I go to do these things.  Edit: also i already have Service Pack 1


$$\lim_{n \rightarrow \infty} \sum^n_{k=1} \frac {1} {k+n} = \ln 2$$  I'm supposed to find the limit and get the right part as an answer. I don't know what to do with it. Could someone explain?


I recently installed MS Teams on ubuntu 18.04 because I needed it for a project. Now I don't need it anymore, so I deleted it's .deb file, hoping that doing this would uninstall the app. But even now, as I turn on my computer, it pops up everytime, which irritates me. I even tried to uninstall it from ubuntu App Center, but couldn't locate it there. Can anyone suggest me how can I uninstall it? Thank You!


Show that$\displaystyle\sum_{n=1}^\infty\frac{\sin( nz)}{n}$ diverges if $\mathfrak{Im} \,(z)\neq0$

We have to show that$\displaystyle\sum_{n=1}^\infty\frac{sin( nz)}{n}$ diverges if $Im\,(z)\neq0$  My try:$$\sin (nz) = \mathfrak{Im}(e^{nzi})$$  $$\sum_{n=1}^{\infty} \frac{\sin nz}{n} = \mathfrak{Im} \sum_{n=1}^{\infty} \frac{(e^{zi})^n}{n} = - \mathfrak{Im} \ln\left(1-e^{zi}\right). $$ Then how to proceed?


If the velocity of an object is zero, does it mean that the acceleration is zero?

I am reading a book and the author threw the  question of the title for us to reflect. After he gave us some example to state that if the velocity of an object is zero it doesn't mean that the accelarion is zero. "For example, when you put your foot on the gas pedal of your car which is at rest, the velocity starts from zero but the acceleration is not zero since the velocity of the car changes. (How else could your car start forward if its velocity weren’t changing—that is, accelerating?)" But for me it doesn't make sense. Of course I believe he is right, I just cannot understand it. I will tell how I see this situation. If the person pressed the gas pedal it will have accelarion and the car will move. In my head there's no "delay". I "delay" would happen if the car skidded. Could you explain how the author sees it?


How to prove $ \phi(n) = n/2$ iff $n = 2^k$?

How can I prove this statement ? $ \phi(n) = n/2$ iff $n = 2^k $  I'm thinking n can be decomposed into its prime factors, then I can use multiplicative property of the euler phi function to get the $\phi(n) = \phi(p_1)\cdots\phi(p_n) $. Then use the property $ \phi(p) = p - 1$. But I'm not sure if that's the proper approach for this question.


Moving the cursor and printing characters in console doesn't work with sleep

I want to print a sequence of characters one by one in the same place. I print one letter, then wait 1 second with sleep, move cursor one column left using console code, print next letter and so on. The problem is as a result program waits the sum of all sleeps (2s in my example) and then prints only the last character ('y'). Same goes with nanosleep, waiting for a signal instead of sleeping. How to make it work?  #include <stdio.h> #include <stdlib.h> #include <unistd.h>  int main() {     printf( "H" );     sleep( 1 );     printf( "\033[1D" );     printf( "e" );     sleep( 1 );     printf( "\033[1D" );     printf( "y" ); }


Displaying author's name in a bibliographic entry in the form: Surname, First Initial of Firstname

\RequirePackage{filecontents} \begin{filecontents}{\jobname.bib} @article{Arter95,     Author = {David Arter},     Date-Added = {2013-08-11 17:38:06 +0000},     Date-Modified = {2013-09-01 15:13:22 +0000},     Journal = {Journal of Common Market Studies},     Number = {3},     Pages = {361-287},     Title = {The {EU} {Referendum} in {Finland} on 16 October 1994:              {A} Vote for the {West}, not for {Maastricht}},     Volume = {33},     Year = {1995}}  @article{Detlef95,     Author = {Jahn, Detlef; Storsved,Ann-sofie},     Date-Added = {2013-08-11 17:14:34 +0000},     Date-Modified = {2013-08-11 17:16:45 +0000},     Journal = {West European Politics},     Number = {4},     Pages = {18-37},     Title = {Legitimacy through referendum? The nearly successful domino‚Äêstrategy of the Eu‚Äêreferendums in Austria, Finland, Sweden and Norway},     Volume = {18},     Year = {1995}} \end{filecontents} \documentclass{article} \usepackage[ngerman]{babel} \usepackage{natbib} \bibpunct{(}{)}{;}{a}{}{,} \makeatletter \renewcommand\@biblabel[1]{} \makeatother  \begin{document}  \cite{Arter95}  \bibliography{\jobname} \bibliographystyle{plainnat}  \end{document}   Please help. I want the author's name displayed like this "Arter, D." instead of David Arter


Why is my iron disappearing in Minecraft?

In Minecraft, I'm in survival with a wooden pickaxe, and whenever I mine the iron ore I need, it keeps disappearing. Why is this happening? Am I doing something wrong?


I am trying to extract the text between two specific line numbers using  sed 'startLine,endLined' myFile.txt   But somehow it keeps extracting from the begining of the file to endLine.  What is wrong here?


I am using a custom script (stream.sh) which starts on boot. However, I want to check after every 5 minutes if the script is running. If it is not running, I want to run it again. How can I configure it in crontab or else?  I am using Ubuntu 18.04.


How to Change maxPasswdAge parameter in OpenLDAP in Linux

I am trying to find how to change  some password policy settings in openLDAP (on a system-wide level -  not on a per user level) such that ALL LDAP account users (ie existing and new users) have their passwords set to expire after 90 days.  I know the main parameter that controls this is the maxPasswdAge parameter but I am not sure how to set this.  We are running openldap 2.3.43 on RHel 5.3.  Can anyone share their experience on this?


How do I stretch my heightmap over the whole plane?  My plane has the dimensions of 6000 x 6000 and I subdivided it so that each pixel should be the value of one rectangle. My heightmap comes with 200 x 200px resolution.  I imported the image as texture, set the 'color space' to 'linear' and the clipped it.    Now I added the modifier  but it only interprets the values on a little area in the middle of the plane.   How do I stretch my heightmap over the whole plane?     The result should be like that


Please fellows, how and what is the best usage, application and difference between the word "Am" and "I am"


So I need to allow the user of my script to choose a directory that contains images, and then run my script on each image. I already have my script made . I looked at  already, but that is about exporting, not importing.  It should look like this:    And should allow the user to choose the directory.  Thanks!


Is it bead art or beads art? (Popular Usage)

It seems that both terms are used to refer to beadwork but beads art seems really weird to me (think Dogs Food).  To be clear, I am not only referring to the rules of usage. I would like to know what is the most common usage - this is important for us as we need to use the preferred copy in our prints. If "bead art" is technically correct, but most people don't resonate with the term, then we would still go with "beads art". Most of the people in my company insist that it's "beads art". I think it's "bead".


Relationship between Account and Opportunity and Account and Contact

On Opportunity there is a lookup relationship to Account.But why it behaves as Master-Detail as we can create Rollup Summary Fields on Account.  Similarly if we delete Account then Contact gets deleted but there is lookup relationship between Contact and Account  What is the relationship between Opportunity/Account and Contact/Account ? (Lookup or Master-Detail)


Does anyone know if/when Internet Explorer will support the "border-radius" CSS attribute?


Stuck when trying to install/upgrade packages

I can't do anything with apt-get because there are a stupid package that blocks it from working. This is what happens:  $ sudo apt-get upgrade Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies:  gimp-help-sv : Depends: gimp-help-common (= 1:2.8-0precise8~ppa) but 1:2.8-0precise16~ppa is installed E: Unmet dependencies. Try using -f.   Ok, I guess I run apt-get -f install then.  $ sudo apt-get -f install Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following package was automatically installed and is no longer required:   icedtea-netx-common Use 'apt-get autoremove' to remove them. The following extra packages will be installed:   gimp-help-sv The following packages will be upgraded:   gimp-help-sv 1 upgraded, 0 newly installed, 0 to remove and 27 not upgraded. Need to get 0 B/29.6 MB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]?  (Reading database ... 803609 files and directories currently installed.) Preparing to replace gimp-help-sv 1:2.8-0precise8~ppa (using .../gimp-help-sv_1%3a2.8-0precise16~ppa_all.deb) ... Unpacking replacement gimp-help-sv ... dpkg: error processing /var/cache/apt/archives/gimp-help-sv_1%3a2.8-0precise16~ppa_all.deb (--unpack):  unable to create `/usr/share/gimp/2.0/help/sv/gimp-tool-crop.html.dpkg-new' (while processing `./usr/share/gimp/2.0/help/sv/gimp-tool-crop.html'): No space left on device No apport report written because the error message indicates a disk full error                                                                               dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing:  /var/cache/apt/archives/gimp-help-sv_1%3a2.8-0precise16~ppa_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)   Ok. But it can't be that I've ran out of space?  $ df -H Filesystem      Size  Used Avail Use% Mounted on /dev/sda2        15G   11G  3.1G  79% / udev            2.1G  4.1k  2.1G   1% /dev tmpfs           828M  1.1M  827M   1% /run none            5.3M     0  5.3M   0% /run/lock none            2.1G  316k  2.1G   1% /run/shm /dev/sda5       125G  103G   16G  88% /home   This is what happens whatever I am trying to do. How can I get rid of those stupid messages?


How to show effectively that every finite group is isomorphic to a subgroup of symmetric group


Does the value of this sum $\sum_{m=0}^\infty \sum_{n=0}^\infty \frac{m+n+mn}{2^m(2^m+2^n)}$ equal $12$?

$$\sum_{m=0}^\infty \sum_{n=0}^\infty \frac{m+n+mn}{2^m(2^m+2^n)}$$ I tried to evaluate this double sum and I got $12$. Is that right ? I will see your answers !!


How do I turn on the Bluetooth on my Snapbridge-enabled Nikon DLSR?

I can't figure out how to turn on the Bluetooth on my Nikon D5600. I have updated the firmware to the latest 1.01 and still the same problem.   Bluetooth is dimmed out on the camera and will not turn on. I get an error message saying, "This option is not available at current settings or in the camera's current state".  I have tried everything I can think of and no go. I can't find help for this problem anywhere on the internet and still no reply from Nikon.  How do I turn on my camera's Bluetooth?


Can we specify DX runtime versions by project?

With Spring '19 around the corner, I decided to set up a pre-release org and upgraded my client to 45.x. After playing around a bit, I then went back to work on my actual work projects, and came across an error:     ERROR:  The configured apiVersion 45.0 is not supported for this org. The max apiVersion is 44.0.   Now, I'm not able to do any work in my sandbox! Is there a way I can use the correct API version in each project? For now, I have to switch between installing salesforcedx@latest and salesforcedx@pre-release each time I want to switch modes.


What happens if your US visa, B1/B2 expires (unused visa) without travelling

What happens if your US visa expires without travelling? Indeed, I have already travelled to the United States before. But with another visa (this unused B1/B2), some family restrictions, my wife's death, prevented me from travelling during the two years of validity of my visa. Would it be a problem to get another visa now?


Are black holes bound to merge once their event horizons touch?

Even if they move toward each other at relativistic velocities and not head-on?  I looked at questions  and , but did not find the answer.


Geometrical Interpertation of Cauchy's Mean Value Theorem

Cauchy MVT: If functions f and g are both continuous on the closed interval [a,b], and differentiable on the open interval (a, b), then there exists some c ∈ (a,b), such that  $$\frac{f'(c)}{g'(c)}= \frac{f(b) - f(a)}{g(b)-g(a)}$$  Lately, after I proved the CMVT, I was trying to intuitively understand (using geometry of course) the meaning of CMVT by comparing it to the MVT; for, I know that the CMVT is just an extension of the MVT, such that the only difference is that $$g(x)=x$$ for the MVT. Yet, even though this is self-evident, I could not inhabit an intuition through a geometric representation of it; for, in all demonstrations of the MVT I have viewed, I only see one function $$f(x)$$ in the geometrical representation, which thusly implies there exists no $$g(x)$$ - not to my perspective at least.So, I searched for another demonstration of the CMVT and I found something related to parametric curves as follows:    And,  since I have not encountered parametric curves, I could not fully grasp this demonstration. So, can anyone help me with my confusions over a graphical demonstration of the CMVT. (Note: If a explanation of this intuition requires a knowledge of parametric curves etc..., feel free to include it in the answer).


How to use results/ideas from a paper I reviewed?

I recently reviewed a paper (general applied mathematics context). During the review, I realized that the fairly general ideas introduced in the paper can potentially be applied to a specific problem in a similar context. The authors did not mention this application in their paper, so I suggested to add a short comment about it in my review.  I later started thinking about the application in more detail and tried out some things, which actually seem to work quite well for this application. Now, the paper is still in the review process and might take some time until it gets published. What is the proper way how to proceed here in order to use the ideas and results which I in my exclusive position as a reviewer saw? How can I refer to the paper that is still under review? How can I best discuss the ideas with my co-workers (and potential co-authors) without disclosing that I reviewed the paper?  The paper under review is not available online on any preprint servers such as arXiv etc


How to resolve error "Handle bad layers" in QGIS?

I'm new to QGIS and have been seeing what it can do for me – seems good. I imported shape file data from a UK Ordnance Survey data file and saved the file in a new folder. It was very good, doing all I wanted. I exported and got exactly what I wanted ( a tiff image).   I closed the file in order to try a new experiment. When I went to re-open it I got a dialogue box saying 'Handle Bad Layers. I don't understand what is at issue and what to do.


Showing that $1+a>0 \implies (1+a)^n \ge 1 + na$

Establish the Bernoulli Inequality if $1+a>0$, then $(1+a)^n\ge 1+na$ for $n\ge 1.$  So far I have  $$(1+a)^k+1 \ge 1+(k+1)a,$$  but I don't know what to do from here to make the left and right side equal. Step by step explanation please!


what's a reason that first for loop take much time instead of second?

Nowadays I'm working on optimization of code and I see a lot of code in which we create a new variable and then initialize as seen in the first loop in an example code below:  BigInteger limit = new BigInteger("10000"); long l = System.currentTimeMillis(); for (BigInteger i = BigInteger.ONE; i.compareTo(limit) < 0; i = i.add(BigInteger.ONE)) {     BigDecimal temp = new BigDecimal(0); } long l1 = System.currentTimeMillis();  //After modification BigDecimal temp1; for (BigInteger i = BigInteger.ONE; i.compareTo(limit) < 0; i = i.add(BigInteger.ONE)) {     temp1 = new BigDecimal(0); } long l2 = System.currentTimeMillis(); System.out.println("1st loop time: "+(l1-l)/1000.0); System.out.println("2nd loop time: "+(l2-l1)/1000.0);   And then in second, I put some modification as shown. My question is both looks familiar, only variable scope is different but the first loop takes much time.   Is this happening just due to an allocation of memory? Or it's a good approach to declare a variable outside for loop but why?


What does the American idiomatic expression "2 x 4"  exactly mean? I've read a very interesting book by Father Donald H. Calloway, No turning back  (an autobiography and a conversion story), and chapter 10 is entitled "The divine 2 x 4". Could that mean the divine surprise, the divine intervention?


Which year does Spider-Man: Homecoming take place in?

The first scene of the movie is presumably set in the immediate aftermath of The Avengers. The movie then fast-forwards to '8 years later'.  But Spider-Man already appeared in Civil War as a high school student, which he still is in this movie. So what's the timeline here? If Avengers was set in 2012 and Civil War in 2016, how can Homecoming be in 2020?  Or am I wrong in assuming the canonical timelines of the other movies?


Problem calling a method from another class android?

I have an app with a menu, my menu has the option to logout from the app  my idea is to create a file to keep all my reusable function so icreate a Support file,  on my support file I have the logout function and I'm trying to call the logout from my mainactivity class,  but I keep getting this error:     java.lang.NullPointerException: Attempt to invoke virtual method   'java.lang.String android.content.Context.getPackageName()' on a null   object reference   I was testing the funciton my only doing "Log.e...." i have able to log the text   public boolean onNavigationItemSelected(MenuItem item) {      int id = item.getItemId();      if (id == R.id.home) {         Toast.makeText(this, "Home", Toast.LENGTH_LONG).show();     } else if (id == R.id.nav_logout) {          com.myapp.myapp.MAIN.Support.Support support = new com.myapp.myapp.MAIN.Support.Support();         support.logout();      }      DrawerLayout drawer = findViewById(R.id.drawer_layout);     drawer.closeDrawer(GravityCompat.START);     return true; }  public class Support extends Activity {       public void logout() {         Intent intent = new Intent(context, com.myapp.myapp.MAIN.Activities.LoginActivity.class);         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);          startActivity(intent);         Log.e(TAG, "Aquii");     } }


I have a scenario where all my file patterns are placed in a text file. Now I need to write a shell script to read each and every file pattern name present in the text file and check it it exists in the directory or not. The output should be written to a log file at final.   #!/bin/ksh file="/usr/opt/filenames.txt" mondir=/home/pavan while read line do         # display list of files with the pattern in the monitoring directory filename=$line ls -lrt $mondir/$filename* done <"$file"   The above code is listing the files. But i also need to print the count(number of files for each and every filepattern name.


I have a HP ProBook 4310s. I'm trying to reset the BIOS on it. When I took apart the laptop, I found that it doesn't have a CMOS battery to help me reset the password.   Does anyone know how else I can reset the BIOS password?


query syntax to select every multiple of nn record (shapefile)

I have data like multiples of 40. 40 80 120 160 200 and so on.    I would like to label every record that is a multiple of 100.  I have tried a couple of methods and can't get them to work either as a query in the label or as a select statement.  "STATION" =  %00   RIGHT ("STATION", 2) =  00     I get invalid SQL statement. Does anyone see what I am doing wrong?    Respectfully I did search and did not see any of the example questions you presented.  However it still does not answer my question, re-stated, what am I doing wrong?


On , change in  is defined as the amount of energy dispersed divided by the absolute temperature. But I want to know: What is the definition of entropy? , entropy is defined as average heat capacity averaged over the specific temperature. But I couldn't understand that definition of entropy:  $\Delta S$ = $S_\textrm{final} - S_\textrm{initial}$. What is entropy initially (is there any dispersal of energy initially)? Please give the definition of entropy and not its change.  To clarify, I'm interested in the definition of entropy in terms of temperature, not in terms of microstates, but would appreciate explanation from both perspectives.


Adjust screen dimensions for better mouse transitions across screens

I have two screens in my setup:   15" 4K laptop screen (Dell Precision 5520) 25" 3K external screen (Dell UP2516P connected through DisplayPort)   Extending displays etc works just fine, except for one thing. Windows thinks the 15" laptop screen is MUCH bigger than the external screen:    This is causing funny issues and jumping windows when moving from Screen 1 to screen 2 and vice versa with my mouse.  I've tried searching, but am stumbling on all kinds of "display scaling" documentation that discusses scaling the contents of the screens, not defining the actual dimensions of the screens.  I have used Windows Update to ensure I have the latest drivers for these displays. . It does show the correct driver for the external display:    I'm hoping for some registry key to tweak to reduce the physical dimensions of the 4K display to it's actual size.


How to interpret the USB MacBook maximum monitor resolution?

I'm wondering if a macbook (USB C only) can support a  monitor display.   The 2018 Macbook has the Intel® HD Graphics 615 card (per .    The  for this graphics card has a confusing table for max resolution which cites: 4096x2304@60Hz, 3840x2160@60Hz.  The card apparently has 16GB of memory.    Although I am a trained electrical engineer I'm not knowledgeable enough to work out if this card can support a 5120 x 1440 display.   Is it as simple as ensuring that:  5120 x 1440 < 4096 x 2304?  Or is it more nuanced than that?


QGIS Points in Polygon Query Not Working

I'm trying to count points within a polygon but it's not working.  I think it has something to do with the co-ordinate system.  The points are from a text file and the line are from a dxf file. I had to set the co-ordinates for both as one was lat long and the other was an old Irish grid co-ordinate system.  When I buffered and dissolve the lines the resulting layer defaulted to the original co-ordinates.  I reset the line file to the correct co-ordinates and ran the query to count points within a polygon. The resulting layer defaulted to its original co-ordinates and all the values were null.


Suspension in chat on more than one site

I have been suspended on , and that includes a suspension on the meta and presumably the chat. However, surely I should be able to chat on others sites such as Area 51 or Stack Overflow? Yet when I went onto the Area 51 chat earlier, it told me that I wasn't allowed to chat because     your account is suspended on the parent site and cannot chat for 14 days.   My chat account is  and you may notice that it says the same message. What should I do? Surely I should be allowed to chat in non-PPCG rooms?


Reading Lookup Filter criteria from SObject field descriptions?

We are implementing a special type of lookup window in a VisualForce page, which displays a set of potential records a user can select from to populate a Lookup value. As a means to allow users to filter potential selections, we wanted to make use the Lookup Filter properties available when configuring a Lookup field.  The only problem is we don't seem to have any way to dynamically access these filter properties through Apex code. The Describe Field Result does not seem to contain this information, and I haven't been able to find anything in the documentation about it.  Is there no way to access Lookup Filter properties from the Apex Schema methods?


So after reinstalling Miktex I can't use subfiles anymore. Anytime \subfile{insert file} is referenced, this error pops up  ! LaTeX Error: File `main.toc' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: toc) Enter file name: ! Emergency stop   This appears in both texmaker and texstudio, and I can compile my files fine on Overleaf, so I believe it's a Miktex issue. Reinstalled, same problem appears. If a table of content is not signified, the error turns into main.out not found, or .out or .aux for the most barebone of subfile usage example. The document compiles fine if \subfile{insert file} is removed. No idea what happened.


I was just wondering if there's a (hypothetical) situation where a photon could accelerate and what the consequences of this might be?


how to stop firing oncomplete if save action has errors

My requirement is to stop oncomplete call if save action has errors. I know I am doing some silly mistake.   Here I am unable to stop calling oncomplete function.  Requirement is, from VFP save method, data will get saved and then perform callout from oncomplete function. If there are any errors during save then stop making callouts.  Visualforce  <apex:page id="hasErrorTestPage" controller="ErrorMessageFinder"  showHeader="false">     <apex:pageMessages id="msgId"/>     <script>         function performCallOutMethod()         {             var msg = document.getElementById('{!$Component.MSEForm.errorMsgInd}').value;             alert(msg);              if(msg == 'false' || typeof(msg) == 'undefined')             {                 alert('entering callout')                 performCallOut();                 return true;             }             else             {                 return false;             }         }     </script>     <apex:form id="MSEForm">         <apex:actionFunction name="performCallOut" action="{!submit}" reRender="panelId,msgId"/>          <apex:outputPanel id="panelId">             <apex:outputText value="{!hasError}" id="errorMsgInd"/>         </apex:outputPanel>         <apex:inputText id="customerNm" value="{!CustomerName}"/><br/>         <apex:commandButton value="Save" action="{!save}"                       oncomplete="return performCallOutMethod();" reRender="panelId,msgId"/>     </apex:form> </apex:page>   Controller  public class ErrorMessageFinder {     public String CustomerName {get;set;}      public Boolean hasError {          get {              return ApexPages.hasMessages();          }            }      public PageReference save()     {            if(String.isBlank(CustomerName))         {             ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.Error, 'Name cannot be null');             ApexPages.addMessage(msg);             return null;         }         return null;      }       public PageReference submit()     {         try         {   //navigate to view page             PageReference pg = new PageReference('/'+ '0019000001UwnVS');             pg.setRedirect(true);             return pg;         }         catch (Exception ex)         {             System.debug('Error in submit ' + ex);             ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.Error, ex.getMessage());             ApexPages.addMessage(msg);              return null;         }     } }   Based on this code, if I hit save button without entering CustomerName then it is not showing error after save. It is showing error during oncomplete call and then navigating to view page, which I do not want.  Any help is appreciated. I have put a compiled code so that anyone can try with this code.


Multiple filed handlers in Views for a field

How do I set multiple field handlers in Views on a single field.  I've applied the patch  to Views which brings in the user relationship on the history table. I then replaced the Views field handler for ['history']['timestamp'] in node.views.inc with this:    $data['history']['timestamp'] = array(     'title' => t('Node last access timestamp'),     'field' => array(       'handler' => 'views_handler_field_date',       'click sortable' => TRUE,       'help' => t('Show the timestamp a node was last accessed by user.'),     ),     'sort' => array(       'handler' => 'views_handler_sort_date',       'help' => t('Sort by the node last access time.'),     ),     'filter' => array(       'handler' => 'views_handler_filter_date',       'help' => t('Filter by the node last access time.'),     ),   );   because I need the timestamp as a date field. Normally it is this:  $data['history']['timestamp'] = array(     'title' => t('Has new content'),     'field' => array(       'handler' => 'views_handler_field_history_user_timestamp',       'help' => t('Show a marker if the content is new or updated.'),     ),     'filter' => array(       'help' => t('Show only content that is new or updated.'),       'handler' => 'views_handler_filter_history_user_timestamp',     ),   );   But ideally I would like to have both field handlers available because I do not want to remove the default handler in Views. How do I do this?


gnome-keyring error sending email in mutt

here is my .msmtprc :  defaults   account gmail   host smtp.gmail.com     from yy@gmail.com   port 587   auth on   tls on   tls_starttls on   tls_trust_file /etc/ssl/certs/ca-certificates.crt    user yy@gmail.com   password xxxxxxxx   logfile ~/.msmtp.log     account default:gmail  here is my  /etc/Muttrc   set sendmail="/usr/bin/msmtp"    set use_from=yes    set realname="xxxx"    set from="yy@gmail.com"   set envelope_from=yes   set charset="utf-8"   set send_charset="utf-8"   set locale="zh_CN.UTF-8"   set content_type="text/html\;charset=utf-8"     When I input:    echo "test" | mutt -s "subject"  xxxxx@163.com   WARNING: gnome-keyring:: couldn't connect to: /home/debian/.cache/keyring-HF6INk/pkcs11: No such file or directory     What is the matter?


Run script as root at login (no sudoer user, shell session)

Much like /etc/profile and ~/.profile but ran by root instead of the user is doing login. /etc/rc.local runs after boot but I need running the script before login. The user is not a sudoer one.   Thanks!


How to access/delete a folder accidentally named with escaped characters?

I was setting up a cloud server and saw that I accidentally added a folder named ^[[4~ (with escape code). I want to see what is inside and if that was just a mistake then remove that directory. However I cannot cd nor ls the contents. I tried finding out the escape code so that I could enter a command like cd \x1b[30m; and hope that it would get me in the directory.  What if I was to cd or remove by searching for the first directory listed with ls. Would that be possible? Because when I do a ls |grep 4 two results come up and one of them is the one I'm trying to access.  Either finding out the folder name in escape string or changing the directory to the first directory ls finds might be a solution here. How can I approach this problem?


How to (or) is it possible to implement logic to entering a " * " to save file and exit after taking scanner input, using PrintWriter class?

I'm trying to get something like this work:  import java.io.PrintWriter; import java.io.IOException; import java.util.Scanner; import static java.lang.System.in; import static java.lang.System.out;   class PrintWrit1  {     public static void main(String[] args)      {         Scanner input = new Scanner(in);         out.print("Enter the filename :\t");         String filename = input.nextLine();         try(    PrintWriter pw = new PrintWriter(filename))         {                out.println("Enter the file content, enter * after finishing");             String text;             while((text=input.nextLine()) != "*")             {   pw.println(text);   }             out.println(filename+" is saved and closed");         }         catch(IOException ioe)         { ioe.printStackTrace();}     } }   File is created, output is written, but instead of * upon hitting ctrl-C, the file is saved but the statements following won't execute and it's terminating abruptly.  I'm looking for any suggestions for that if I enter * after entering the last line, it should be able to execute out.println(filename+" is saved and closed")  Current output:  D:\JavaEx\FILE-IO>java PrintWrit1 Enter the filename :    sample Enter the file content, enter * after finishing line1 line2 *   Expected output:  D:\JavaEx\FILE-IO>java PrintWrit1 Enter the filename :    sample Enter the file content, enter * after finishing line1 line2 * sample is saved and closed


After estimating the data using xtreg, re, I notice there're 3 different measures of R-squared, within, between, and overall R-2, so my question is, can I just report the overall R2 in this case since I'm using the random effects option? Thanks.


I would like to know how many tolls are between Maryland and Canada. Planning a road trip to Niagara Falls, Canada and need to know how much in tolls I'll need to pay?


What is the differences between &> and 2>&1

There are two forms of redirection the standard output and standard error into standard output. But which one is better? and why the &> is considered the perfect?  I can't find what is the differences so that many tutorials and even bash manual state that  &> is better!   So Why shall I use &> and not 2>&1  Mainly using bash shell    EDIT: Thanks for commentors   Only >& works in csh or tcsh  In ksh only 2>&1 works.  dash use >file 2>&1 redirection only  Then which one to use to ensure my script is compatible with other systems whatever the used shells are!


Question about understanding the behavior of the universe

This is a hypothetical question, and if this is not the place to ask it, i have zero problem in deleting it, but as i have asked some question in the similar "field" and always got interesting answers, i'm going to ask it anyway. So, if we had an machine, or whatever, capable of calculating every single possible force in the universe, everything that affects matter or energy, would we be able to predict the future ? since we would know where every particle would be in any point in time, because we know what would affect that particle and how it would affect it. One of the problems that i can think of, is life itself, because some of our particles behave unpredictably because of the capability of thinking. (A little more philosophical now) would the machine become the Universe ? Sorry if this is just an stupid question, but thanks anyway!


Can I "upgrade" to the same version of Ubuntu?

Each time I put a bootable drive in the usb slot, it asks me if I want to install it. Can I use it to reinstall my OS without formatting my harddrive?


Does Diffusion Sliver protect from boardwipe spells and sacrifice spells?

If I have a  out, are my Slivers protected from ? What about ?


What does the logical condition "implies" actually mean?

$P_n$ and $Q_n$ are propositions which has a truth value $n$ where $n \in (T,F)$  So i want to access the truth value of $P\Rightarrow Q$  So  $P_T$ and $Q_T$, $(P \Rightarrow Q)_T$  $P_T$ and $Q_F$, $(P \Rightarrow Q)_F$  $P_F$ and $Q_T$, $(P \Rightarrow Q)_T$  $P_F$ and $Q_F$, $(P \Rightarrow Q)_T$  I don't really understand the last 2 statements. Can anyone explain them?  Like for  (2), If P is true then Q is false, then  $P \Rightarrow Q$ is false. that is self evidential. But how about (3) and (4) i can't seem to understand


Can sequester be used to get nearly unlimited duration spell effects?

As a follow-up to , consider the following situation:   Be a wizard of a level high enough to cast  Have a spellcaster friend that is willing to sacrifice himself "for the greater good" cast a beneficial concentration spell on you (for example, ) Sequester your friend while he is concentrating. This stops him in time, allowing the effects of bless to remain on you forever (or until something dispels either sequester or bless) Repeat the above for different casters and spells and enjoy a plethora of concentration effects on yourself (and why not your party as well)   This method appears to be only limited by how many spellcasters you can convince to be willing to be sequestered (starting a school/order promising "eternal life" may help).  Apart from being a cheesy plan that a DM is unlikely to allow, would this actually work by RAW?


Where to securely store API keys and passwords in WordPress?

I'm looking to use a few APIs and many come with keys, secret keys and passwords required to work. Where in WordPress can you store that information? Assuming anyone can hack your DB is there anyway for WordPress to make saving that information more secure? Also, consider the ability to change these keys ever so often so I would need to update the keys on an options page.  UPDATE


Replacing pattern only when it matches a whole word

Lets say I try to replace in a like this   asdasdasdHit Hitasdasd Hit Hit Hitasda Hit Hit asdaHit Hit Hit Hit Hitasda Hit ... ...   Is there  a way to get every "clean" Hit replaced with OK? I tried /g but then everything gets an OK  With s/\ Hit\ /OK/g the Hit on the newline gets lost.


Is the accelerated expansion of the universe consistent with conservation of energy?

If energy can neither be created nor destroyed, how come the universe is expanding at an accelerating rate? Where does this energy come from?


If Magical Curses in Harry Potter only work on humans and other tangible objects, how did Voldemort curse the DADA position, if it was intangible?

As stated in the title above. How do you curse a non-intangible thing? I know you can curse people, and they experience pain or something unpleasant, or objects which destroy them, but how do you curse something intangible?


Can I just change straightforward wheel axles to QR skewers?

I've just bought a second hand road bike which doesn't have Quick Release Skewers.   Can I just buy a set of QR Skewers and fit them?   Are they a standard size?  Are there any gotchas waiting to bite me if I do change to them?  Is there anything specific I need to look for in order to change to QR Skewers?


Let $\{K_n \}_{n \in \mathbb{N}}$ be a collection of sets, where $K_n = [n, \infty)$. Why is $\bigcap_{n \in \mathbb{N}} K_{n}$ empty?

This question is related to Exercise 2.15 in Baby Rudin, in which the reader is instructed to "[s]how that Theorem 2.36 and its Corollary become false (in $R^1$, for example) if the word 'compact' is replaced by 'closed' or by 'bounded.'"  The relevant theorem and corollary are as follows:  Theorem 2.36: If $\{K_{α}\}$ is a collection of compact subsets of a metric space $X$ such that the intersection of every finite subcollection of $\{K_{α}\}$ is nonempty, then   $\{K_{α}\}$ is nonempty.  Corollary: If $\{K_{n}\}$ is a sequence of nonempty compact sets such that $K_{n}$ contains $K_{n+1},  (n = 1, 2, 3, ...)$, then   $K_n$ is not empty.  My Question: I realize this question and similar ones have been asked elsewhere on MSE, but I've yet to see a straightforward (to me, at least) answer to my question specifically. Usually, for the "closed" part of the exercise, the following collection of closed sets, $\{K_n \}_{n \in \mathbb{N}}$ is used:  $$K_n = [n, \infty), n \in \mathbb{N}.$$  For, the intersection of every finite subcollection of ${K_n}$ is clearly nonempty. Indeed,  $$ \bigcap_{i=1}^{m} K_{n_{i}} = [N, \infty) $$  where $N = \max\{n_1, n_2, ..., n_m\}$.  Then, the assertion is made that   $$ \bigcap_{n=1}^{\infty} K_n = \emptyset. $$  However, I don't see how the same argument can't simply be used, i.e., that, for example, $N \in  \bigcap_{n=1}^{\infty} K_n$ (or maybe, say, $n+1$). Intuitively, this certainly makes sense, I'd say. For, given the archimedean property, it seems that as $n$ approaches infinity, we can always find an $l$ in each increasingly smaller set such that $n < l < \infty$; and so $l \in  \bigcap_{n=1}^{\infty} K_n$.  What is it exactly that I'm misunderstanding or overlooking here?


Pointwise but not uniform convergence of continuous functions on $[0,1]$

As I was going over the definitions of pointwise and uniform convergence I came to the following problem: since the canonical example for continuous functions on $[0,1)$ which are pointwise but bot uniform convergent(wrt the constant function $f=0$) is sequence of functions $f_n(x) = x^n$ I ask myself is there such sequence of functions for the interval $[0,1]$. So far I couldn't think find any example and I am stating to believe that the answer might be negative. So what do think, is there such sequence and if not can it be proven that such sequence does not exist?


I wanted this:    Hence my solution was  Solution: \begin{enumerate}[label=(\alph*)] \item  \leavevmode\\[-2.75\baselineskip] \begin{flalign*} \mbox{US}\$10 &= \mbox{S}\$10\times1.33&\\ &= \mbox{S}\$13.30& \end{flalign*} \item  \leavevmode\\[-2.75\baselineskip] \begin{flalign*} \mbox{S}\$1 &= \mbox{US}\$1 \div1.33&\\ &= \mbox{US}\$0.75188&\\ \mbox{S}\$20 &= \mbox{US}\$20\times0.75188&\\ &= \mbox{US}\$15.04\mbox{ (2DP)}& \end{flalign*} \end{enumerate}   Is there a more elegant way of doing this? As I need to guess about the spacing to shift up the equation beside (a) using [-2.75\baselineskip].


How do i hang shelving on drywall over concrete

i do know that there is concrete behind the drywall because it is a fire wall. I cannot drill into it for obvious reasons not to mention, the owner wont allow it. Any ides? thanks. Lewis


I have JavaScript function with pass one parameter to   <script type="text/javascript"> function myfun(var1) {    var returnVal = "<?php echo get_value(); ?>"; } </script>   I want to pass JavaScript variable i.e. var1 to get_value();


Different Likert scales used in statistical anlysis

I am using different Likert Scales in questionnaire. Three dependent variables have Likert scales of 4 points, 2 points and 2 points. Three independent variables have 3 points scales. One moderating variable has 3 points Likert Scale whereas the other moderating variable has three questions with 4 points, 3 points and 3 points scales. If I use average of each variable in statistical analysis to find correlation, regression and moderated regression, is it allowed and results are considered valid or not?


What is the correct use of hyphens and capitals in "Big Brother style pop competition"?

Not sure it technically should have any, but a Big Brother style pop competition feels like quite a mouthful as it is so I’m wondering whether hyphens might help.  Also want to check the capitalization of Big Brother is accurate.


I have one file like:  ID_SOUR_CALENDAR BIGINT NOT NULL DEFAULT 0  COMPRESS 0 , UNIQUE PRIMARY INDEX ( CALENDAR_DATE ); ID , ID_SOUR , PRIMARY INDEX ( CALENDAR_DATE );   I want to replace the ',' by ')' in the line just before the line containing PRIMARY.  The result should be:  ID_SOUR_CALENDAR BIGINT NOT NULL DEFAULT 0  COMPRESS 0 ) UNIQUE PRIMARY INDEX ( CALENDAR_DATE ); ID , ID_SOUR ) PRIMARY INDEX ( CALENDAR_DATE );


Is in python 2.7.10 '[[]]*2' different than ' [[],[]] ' ? Aren't they both same?

I was solving a problem using python2 and I used  'seq= [[]]*2' because I wanted this '[[],[]]. But I got wrong answer. Then I tested it in IDLE like this:  >>>s=[[],[]] >>>seq=[[]]*2 >>>seq [[], []] >>>s[0].append(5) >>>s [[5],[]] >>>seq[0].append(5) >>>seq [[5],[5]]   I am totally confused. Can anyone help me? Please.


How can I stop my animation looping (Dope Sheet)

Hello i'm new to Blender and animations,and I have no idea how can I stop my animation from looping infinitely... Could someone tell me please how to stop it?


I don't know how to delete meshes. I know I can create them using the create tool but I'm not sure how to delete objects. Can someone please help me?


I designed my site with Acquia Dev Desktop on my PC and now it's finished and I uploaded folder of my site to public_html folder in cpanel. I export my database on my computer and import it to my host. but now when I enter my url in address bar of a browser only front page shown, for example when I click on other content of my site it gos to a white page and nothing will loaded.  what should I do? pleas help me. which command of setting.php file should change after importing database on server? this is my site:


UnicodeEncodeError: 'charmap' codec can't encode - character maps to , print function

I am writing a Python (Python 3.3) program to send some data to a webpage using POST method.  Mostly for debugging process I am getting the page result and displaying it on the screen using print() function.  The code is like this:  conn.request("POST", resource, params, headers) response = conn.getresponse() print(response.status, response.reason) data = response.read() print(data.decode('utf-8'));   the HTTPResponse .read() method returns a bytes element encoding the page (which is a well formated UTF-8 document)  It seemed okay until I stopped using IDLE GUI for Windows and used the Windows console instead.  The returned page has a U+2014 character (em-dash) which the print function translates well in the Windows GUI (I presume Code Page 1252) but does not in the Windows Console (Code Page 850).  Given the strict default behavior I get the following error:  UnicodeEncodeError: 'charmap' codec can't encode character '\u2014' in position 10248: character maps to <undefined>   I could fix it using this quite ugly code:  print(data.decode('utf-8').encode('cp850','replace').decode('cp850'))   Now it replace the offending character "—" with a ?.  Not the ideal case (a hyphen should be a better replacement) but good enough for my purpose.  There are several things I do not like from my solution.   The code is ugly with all that decoding, encoding, and decoding. It solves the problem for just this case.  If I port the program for a system using some other encoding (latin-1, cp437, back to cp1252, etc.) it should recognize the target encoding.  It does not.  (for instance, when using again the IDLE GUI, the emdash is also lost, which didn't happen before) It would be nicer if the emdash translated to a hyphen instead of a interrogation bang.   The problem is not the emdash (I can think of several ways to solve that particularly problem) but I need to write robust code.  I am feeding the page with data from a database and that data can come back.  I can anticipate many other conflicting cases: an 'Á' U+00c1 (which is possible in my database) could translate into CP-850 (DOS/Windows Console encodign for Western European Languages) but not into CP-437 (encoding for US English, which is default in many Windows instalations).  So, the question:  Is there a nicer solution that makes my code agnostic from the output interface encoding?


Retrieve a complete list of installed packages

I am completely reinstalling kubuntu to my machine since gnome crashed occasionally for its long standing bugs.  How could retrieve a list of all the packages I have ever apt installed and install them to a fresh kubuntu system with one command line?


Why is $dB^2=dt$? Every online source I've come across lists this as an exercise or just states it, but why isn't this ever explicitly proved? I know that $dB=\sqrt{dt}Z$, but I don't know what squaring a Gaussian random variable means.


What is the most accurate explanation of Zeno's Achilles and the Tortoise paradox?

I heard Zeno's "Achilles and the Tortoise" paradox is resolved using the limit concept of mathematics, i.e., the time cost in every sub-race is added up, which has a limit, not limitless, so Achilles can catch up the Tortoise finally. That resolution is based on two assumptions:  the catch-up time equals to the sum of a series the series is convergent and the sum of the series is a limited number  The second assumption can be strictly proved in math. But how to prove the first assumption?


How do I implement __getattribute__ without an infinite recursion error?

I want to override access to one variable in a class, but return all others normally.  How do I accomplish this with __getattribute__?  I tried the following (which should also illustrate what I'm trying to do) but I get a recursion error:  class D(object):     def __init__(self):         self.test=20         self.test2=21     def __getattribute__(self,name):         if name=='test':             return 0.         else:             return self.__dict__[name]  >>> print D().test 0.0 >>> print D().test2 ... RuntimeError: maximum recursion depth exceeded in cmp


I am confused about definition of the boundary set. Definition: Given set $A$ and its complement $A^c$; Point $x$ belongs to the boundary of $A$ if every open ball centred at $x$ contains points of $A$ and $A^c$.   Now to my confusion: Taking as an example set $A\subset \mathbb{N}$ and its complement in $\mathbb{R}^1$. Set $A$ does not contain any limit points. Then for $\forall x\in A$ the only member of $A$ that is contained in all the balls centered at $x$, is $x$ itself. Now, $x\notin A^c$ but is a limit point in $A^c$, hence every ball centered at $x$ contains elements of $A^c$. Can I conclude that $x$ is in the boundary set of $A$, even though it is an isolated point in $A$? Also, say if the complement of $A$ is also in $\mathbb{N}$, will $x$ still be a boundary point of $A$?  Thanks a lot in advance! And I apologize for the clumsy language :-)  Leon


View and preview look different for strange inner code

I found the following post:    that contains code in code (because there are 2 scroll bars in the same main window).  But if I access the following URL:  I can see that the preview looks different.  Probably view & preview must show the same thing.  The usage that generated that strange view is bizarre, but I could find it useful in some other particular situations (to simulate something like block collapsing).


The scene is:  Wizards have gathered for a once a year forging of a ring of power. The ring is struck only once each year. There are required to be mythical beasts (don't remember which one) in the room when the forging takes place.  The wizards have to feed these beasts all year long for this one event. Complaints are made if the ring will ever return the resources required to forge it.  The main character, a young student, is in attendance at this forging.  I can't remember if this is a scene from a Deryni novel or some other novel from the 70s or 80s.


Why, in some instances, do some (desktop) web pages open the navigation drawer on the right hand side of the page? Is there a specific reason why the left side isn't always preferred?  If yes:    Why so?  What research is there to prove this?   Here are the examples below of right-sided navigation drawers:


ubuntu 18.04: not releasing old IPs from DHCP

We're running ubuntu 18.04, with the following configuration of netplan:  network:   version: 2   renderer: networkd   ethernets:     ens3:       dhcp4: yes   Currently we're running into an issue with DHCP, seems old IPs are not being freed after assigning a new one:  2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000     link/ether 00:1a:4a:X:Y:Z brd ff:ff:ff:ff:ff:ff     inet 10.X.Y.175/23 brd 10.X.Y.255 scope global ens3        valid_lft forever preferred_lft forever     inet 10.X.Y.201/23 brd 10.X.Y.255 scope global secondary dynamic ens3        valid_lft 3136sec preferred_lft 3136sec     inet 10.X.Y.168/23 brd 10.X.Y.255 scope global secondary ens3        valid_lft forever preferred_lft forever     inet6 fe80::21a:4aff:fe97:5f31/64 scope link         valid_lft forever preferred_lft forever   This is generating duplicated IP addresses as some IPs are being reused but not freed, generating to the users a lot of issues.  What is causing this behavior and how can it be solved?


I have found and read full  which is useful to edit/add the question or answer.  It looks so pretty for me and to all.  My question is: Is there any format to show the badge as it is visible on profile or badges list?  Example: For tag format, I used [tag:tagname] which gives the output like: .   But I have not found any such formatting option for badges which will give us the output like:     If anybody has idea how to get such format then let me know. And if there is no such format then I request to add this format.  I also want the reviews from other users that is it good idea as there are more than 1.5K questions related to this and there are no lighlighting for badges names?


I would like to have a history of the "About me" box in my profile.  I edited my details on my profile page and it replaced all profiles with the same content, so I'd like to be able to go back to the old information.  Having a complete history of all information would be of use to moderators.


Let $X \subseteq \mathbb{R}$ an uncountable set. So the set of limits points ($X'$) is uncountable.  I understand this intuitively but I don't know how the information "$X$ is uncountable" is useful to get informations about $X'$


I would like to know where I can find the logs for the following package managers:   Synaptic Package Manager Ubuntu Software Center The logs when using the terminal with apt-get


If $M$ is an Artinian $R$-module then $R/\mbox{ann}(M)$ is an Artinian ring?

It is easy to show that if $M$ is a Noetherian $R$-module then $R/\mbox{ann}(M)$ is a Noetherian ring. Is there a similar (or dual) result for Artinian modules?


Understanding Coordinate System Transformation in ArcMap?

For the Data Frame Properties on a map in ArcMap, what is the difference between selecting a new coordinate system and using a Transformation?


Nature of the electric field of a photon

I only have a basic, mostly classical understanding of physics and am just starting to learn about photons. Am I correct in saying that, as a photon moves through space, the strength of its electric field varies? If I am correct, what is the qualitative nature of this field? Is it positive (would repel a nearby proton it was passing by) or negative (would attract a nearby proton it was passing by)? Does it switch between positive and negative? Or would it have no effect on a proton it was passing by (the field is neither positive or negative)? If the field is neither, how is it even possible for an electric field to exist without being positive or negative? What would such a field even mean?


Should I say "there is a handful of..." or "there are a handful of...."?

I want to write that I have handful of somethings.  Which of these is the correct form?   There is a handful of somethings. There are a handful of somethings.   Are both correct?


Alternative of "??" for non nullable types (e.g. when looking up dictionary keys)

It's very convenient using inline sugar like that: obj?.func(); and obj ?? anotherObj  But I'm trying to find an alternative to the same approach in case I want to pull data from a dictionary without knowing whether the dictionary has the key I'm looking for or not.  Specifically I'd like to do something equivalent to:  someDictionary[someKey] ?? anotherValue such that, if key exists it would use the corresponding value in the dictionary and if not, it will use anotherValue. Obviously it's not possible to use as I wrote it here since it makes no sense, but the idea behind it is sound.  Is there a way to simplify it to be used inline, without making a separate check with if?


Windows 8 failing to install on VirtualBox in ubuntu 12.10

I'm getting the errors attached as screenshots above when I try to start the virtual machine so that it installs windows 8. When the first error popped out, I clicked on continue and it brought the windows 8 logo for 3 minutes then it showed the black screen with the second error. I have also tried it with Physical Address Extension disabled and it brings the Windows 8 Recovery error. The host machine is a 4GB ram Intel Core 2 Duo CPU T6570 @ 2.10GHz × 2 and the Virtual machine has 1GB with 1 CPU. How do i get this virtual win8 machine to work?


Esoteric "Undefined Reference to" error with custom template LinkedList class

I'm learning basic Linked Lists and wanted to try my hand at writing my own implementation.  However, I keep getting the following errors when compiling:  /tmp/ccNerPXr.o: In function `main': main.cpp:(.text+0x10): undefined reference to `LinkedList<int>::LinkedList()' main.cpp:(.text+0x2c): undefined reference to `LinkedList<int>::insert(int const&)' main.cpp:(.text+0x49): undefined reference to `LinkedList<int>::displayList()' collect2: error: ld returned 1 exit status   I've looked at other stack overflow answers and couldn't find one to meet my specific issue. The name of the template class matches the instance declaration in main, I remembered to #include "LinkedList.h" properly, and I double-checked to make sure the forward declarations in *.h matched the ones in *.cpp. What else could be causing this error? Is it staring me in the face, and I'm just too blind to see it?  I feel like this might be simpler than what I'm making it...  Here is my (unfinished) source code for reference:  main.cpp       #include "LinkedList.h" #include <iostream>  using namespace std;   int main()  {      LinkedList<int> normList;     for(int i = 0; i < 5; i++)          normList.insert(i);        normList.displayList();       return 0;  }    LinkedList.h   #ifndef LINKEDLIST_H #define LINKEDLIST_H #include <cstddef>     template <class Object> class LinkedList   {      struct ListNode     {          Object element;          ListNode *next;         ListNode() : element(0), next(NULL) {};           };           ListNode *head;          ListNode *tail;       public:          LinkedList();            void insert(const Object &x);          void erase(const Object &x);          void eraseList();          void displayList();   };   #endif    LinkedList.cpp   #include "LinkedList.h"  #include <iostream>  using namespace std;   template <class Object> LinkedList<Object>::LinkedList() {      head = NULL;  }     /*This function will insert an object *using the tail-end insertion method *i.e., inserting at the end of the list   */  template <class Object> void LinkedList<Object>::insert(const Object &x)  {     ListNode *newNode = new ListNode(x, NULL);       if( !head ) {          head = newNode;        tail = head;       } else {          tail->next = newNode;         tail = newNode;               }   }//insert()   template <class Object> void LinkedList<Object>::erase(const Object &x)  {      ListNode *prev;    } //erase()  /* *Function that deletes entire list  */  template <class Object>  void LinkedList<Object>::eraseList()  {      ListNode *prev;     while(head->next)      {            prev = head;          delete head;          head = prev->next;      }   }//eraseList()  template <class Object>  void LinkedList<Object>::displayList()  {      if(!head)          cout << "The list is empty\n";       while(head->next)      {          cout << head->element << endl;          head = head->next;      }     } //displayList()    Thanks in advance to any help or input


How do I get text messages from broken Samsung Fame

dropped phone grrr.  Screen cracked, it lights up but, I can't swipe the screen. I have linked to Kies, got my Contacts over, But, I can't seem to find Texts/sms. Any help greatly appreciated. Sue Samsung Galaxy Fame.


How can you use magnets to rotate a shaft, which in turn powers a generator?

I recently was given the task to create power using magnets, I would think that if I were to put some same poled magnets together, and they were facing the same poled magnets, they would repel and rotate around a shaft.


Reference to the search bar position needs to be updated

Every site's help center says the following in :     Enter search terms in the search box that appears in the upper right corner of every page, and press Enter.   The search box is no longer in the upper right; it's in the center of the top bar. This wording ought to be corrected.  This recently resulted in a support request to one site from a newbie trying to understand what was going on.


How can I parse JSON output on the shell?   For example, Amazon Web Services provides a CLI to retrieve the status of your instances:  $ aws ec2 describe-instances <my_instance_id>   But the command returns a JSON string. The output of that command looks like this:  $ aws ec2 describe-instances x12345 {     "Reservations" :      {               "OwnerId": "1345345"             "Groups": [],              "SecurityGroups": [                {                   "Foo" : "yes"                   "Bar" : "no                }              ]      } }   Are there an shells built-ins that could be used to parse JSON output?   For example, I would like to capture in a shell variable FOO, the following output["Reservations"]["SecurityGroups"][0]{"Foo"}.   In case it helps, I am specifically interested in solutions that could work from Zsh.


I am fairly new to LaTeX, so please bear with me! :)  So my problem is the following: I have a LaTeX document with several subsections. I write in German, so I have to use Umlauts. Using them normally without the \"u trick worked fine, but now after line 246 LaTeX fails to compile because of the Umlauts. The first ~240 lines are ok though. I am using inputenc and fontenc. The document itself is in UTF-8, just like the setting for my inputenc.  I really have no idea what could have caused this, why the problem only occurs in a few lines, and why it does not apply to the whole document (and also why LaTeX stops compiling altogether!).  Thanks in advance for your help!


How to make Unity Launcher show on desktop, but hide when maximized program is open?

I'm looking for a way to make the Unity Launcher always show while the desktop is visible, but hide when a program like Firefox or any other maximized program is open.  The only other "solutions" I've found for this seem to involve keyboard shortcuts, which I don't want. The previously available Dodge Windows feature sounds like what I need, but unfortunately is no longer supported.  Is this possible? If so, how?


A noun that really does not have a plural

I recently wrote an answer about the verb agreement when using the word "some", and I needed a noun that didn't have a plural. I had a discussion about this with , that has been moved to .  But we didn't really find a noun that absolutely does not have a plural. Do you know a noun that doesn't have a plural?


Is there a way to tell Academia.edu "My downloading a paper is not an opt-in to be spammed with ongoing related papers"?

I started exploring for sources for a paper I am working on on Academia.edu, downloaded a few papers, and got an annoying stream of (from my perspective) unsolicited related papers in my inbox. I tried to unsubscribe. I looked at another paper, and found a fresh stream of new papers in my inbox, and unsubscribed with the most forceful option available, and in this or a previous attempt stated I had not opted in to a stream of emails and further emails on the topic would be reported as spam. I was told I had been unsubscribed from all emails. I looked at another article and the spam continued again. I can easily enough set up a Gmail filter to block such emails, but as a matter of principle, is there a way to tell Academia.edu "I am downloading this paper because I just want to download this paper. I am not opting in to an open-ended stream of papers connected to the one I read."?


Transform user generated content file names URL safe

I built an uploader where users can upload their own files. The way I name the saved files is: const fileName = generateRandomString(10) + "_" + file.name; I want to add the file.name so the user can "double-check" that the right file was uploaded when I return the link to them. However, I now ran into some issues that people named their files with spaces or special characters such as ö, ä, or ß which shouldn't be in a URL name. Do you have any advice on how to transform file.name in an URL safe way?


apache virtualhost redirection on ubuntu 14

I had set up 2 domain virtualhost files under /etc/apache2/sites-available,   www.example.com.conf example.com.conf   apart from the default configurations.  I've been trying to create a redirection from example.com to www.example.com and it doesn't seem to work, I don't know where I'm going wrong.   In www.example.com.conf  <VirtualHost *:80>     ServerAdmin webmaster@localhost     ServerName www.example.com     DocumentRoot /var/www/project </VirtualHost>   In example.com.conf  <VirtualHost *:80>     ServerName example.com     ServerAdmin admin@mailzak.com     DocumentRoot /var/www     Redirect / http://www.example.com/ </VirtualHost>   After adding them, I had configured with "a2ensite" and restarted Apache. But the redirection doesn't work.


What do you call a person who uses vulgar words too often?

Is there a word which has this definition:     usage of vulgar or abusive words too often especially while chatting or talking to someone or while giving a speech.   What do you call a person who uses abusive words too often without needing to.


Math mode trouble with backslash in Texstudio

In text studio, when you start typing \( it automatically fills in to \(\) with the cursor in the middle. As I try to type let's say a greek letter such as "\gamma", the editor automatically uses the backslash from \), meaning that I end with \(\gamma) instead of \(\gamma\) of course.   Is there a way for the editor to stop trying to auto-complete that aspect as it is always doing it wrong?


How to get a item history only that it was selected in Open Menu by right clicking

I want to ask how to get id of element which was clicked by right clicking in open menu. I must know ID of this element to show only that history the element what was clicked fom open menu:


Is time unbounded in the future direction?

Time likely had a beginning, because of the big bang theory. But will time ever end?


Convert /etc/network/interfaces to netplan for floating IP

I am new to the netplan on Ubuntu 18.04, just discovered it exists today. I have an interface that I am trying to add to create a floating IP on google cloud. It is based on this example:   I tested the example, and it works, but now I try to do the same on ubuntu, and I don't know how to convert this:  cat << EOF >> /etc/network/interfaces auto eth0:0 iface eth0:0 inet static     address 10.190.1.1     netmask 255.255.255.255 EOF   to netplan.  The output for ls /etc/netplan is '50-cloud-init.yaml'. and the output for cat /etc/netplan/*.yaml is:  network:     version: 2     ethernets:         ens4:             dhcp4: true             match:                 macaddress: 42:01:0a:8e:00:3e             set-name: ens4   my ifconfig:  # ifconfig  ens4 ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460     inet 10.142.0.62  netmask 255.255.255.255  broadcast 0.0.0.0     inet6 fe80::4001:aff:fe8e:3e  prefixlen 64  scopeid 0x20<link>     ether 42:01:0a:8e:00:3e  txqueuelen 1000  (Ethernet)     RX packets 9430  bytes 1635180 (1.6 MB)     RX errors 0  dropped 0  overruns 0  frame 0     TX packets 13383  bytes 1513428 (1.5 MB)     TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0   What is the equivalent of what he said to put in the file, for netplan?


I am trying to utilize Python classes for defining and organizing functions that will make Rest API calls. The functions are interrelated to some extend and hence I am trying to use Classes to organize them. The structure I have in mind is as below:  Main_Class (holds the common variables and funcs. like say clean_dict()) | |-- Sub_Class1  |   (Modifies the URL to access some Service 1) |       |-- Func1 (makes the actual API call and returns result) |       |-- Func2 |-- Sub_Class2 |   (Modifies the URL to access some Service 2) |       |-- Func1 (same name, but unrelated to above Func1) |       |-- Func3   Currently I have written this as Nested Classes. From within the __init__ of Main class, I initialize the subclass objects too and pass some variables to it. This allows me to call the functions within subclass like below. This is something I want to do because its looks cleaner to me and provides someone who reads code later an idea where everything is coming from:  main = main_class(common_args) var1 = main.subClass1.Func1(specific_args_for_this_func) var2 = main.subClass2.Func1(specific_args_for_this_func) var3 = main.subClass1.Func3(specific_args_for_this_func)   Issue is, I want to use the common clean_dict() function defined in Main class within the subclass functions. With Nested Classes, I understand this wouldn't be possible.  So, what is the best approach so that    I can keep the structure of how I call the functions with dot notation and While being able to access some common function defined in a main/parent class?   From my understanding, if I do class inheritance instead, I would have to initialize each subclass separately and code would be like below:  subClass1 = Sub_Class1(common_args) subClass2 = Sub_Class2(common_args) var1 = subClass1.Func1(specific_args_for_this_func) var2 = subClass2.Func1(specific_args_for_this_func) var3 = subClass1.Func3(specific_args_for_this_func)   I guess it goes without saying that I am only an intermediate level programmer and hopefully answer to this wouldn't be too complex.


How do I comment on an answer in StackExchange sites (e.g., StackOverflow) and what StackExchange site should I have asked this on?

How do I comment on an answer in StackExchange sites (e.g., StackOverflow) and what StackExchange site should I have asked this question on?


After force upgrading dabs in my android application I'm getting the following error from some devices:     Caused by java.lang.NullPointerException: Attempt to invoke virtual   method 'int android.database.sqlite.SQLiteDatabase.getVersion()' on a   null object reference          at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.getWritableDatabase(SQLiteAssetHelper.java:178)   Have anybody ever faced with this kind of problem and how you solved it? Thank you!  UPD: Adding the implementation of my DBManager class:  public class DBManager {      private SQLiteDatabase db;     private Context context;      public DBManager(Context context) {         DBHelper dbHelper = new DBHelper(context);         db = dbHelper.getWritableDatabase();         this.context = context; }  private class DBHelper extends SQLiteAssetHelper {     private static final String DB_NAME = "database.db";             private static final int DATABASE_VERSION = 5;          public DBHelper(Context context) {             super(context, DB_NAME, null, DATABASE_VERSION);             setForcedUpgrade(5);         }       } }


Were there any Dark Lord sympathizers from other countries?

I can't seem to remember, but were there any followers of Voldemort from other countries, any outsiders that sympathized with Voldemort's aims? (Not Dragomir Despard) Death Eaters are NOT included in this category.


JS - my varible is not defined in console.log

Uncaught ReferenceError: lastn is not defined     at verify (index.js:63)     at HTMLButtonElement.onclick (index.html:12)  I wanted to know why I get an "undefined" error on the console? I am sure the variable has been defined . Take a look at my code.


I have a string, lets say "123|ABC|test|12345|FF" and I want to xor the ascii value of each character and print the result in hex.  What is the simplest way?


I am facing a weird Java behavior in following code (it lists folder with 1 sub folder, 2 .mp4 files, and 1 .mp3 file). I am trying to asign different icons to video and other files:      private void fill(File f) {     File[]dirs = f.listFiles();      this.setTitle("Current Dir: "+f.getName());      List<Item> dir = new ArrayList<Item>();      List<Item> fls = new ArrayList<Item>();      try{          for(File ff: dirs)          {              Date lastModDate = new Date(ff.lastModified());             DateFormat formater = DateFormat.getDateTimeInstance();             String date_modify = formater.format(lastModDate);             if(ff.isDirectory()){                   File[] fbuf = ff.listFiles();                 int buf = 0;                 if(fbuf != null){                      buf = fbuf.length;                 }                  else buf = 0;                  String num_item = String.valueOf(buf);                 if(buf == 0) num_item = num_item + " item";                 else num_item = num_item + " items";                  //String formated = lastModDate.toString();                 dir.add(new Item(ff.getName(),num_item,date_modify,ff.getAbsolutePath(),"directory_icon"));              }             else             {                 String ext = "";                  ext=getFileExtension(ff);                 Log.d("Zox","'"+ext+"'");                 if(ext!="mp4"){                     Log.d("Zox","'"+ext+"'");                     Log.d("Zox","FU");                 }                 else {                     fls.add(new Item(ff.getName(), ff.length() + " Byte", date_modify, ff.getAbsolutePath(), "file_icon"));                 }             }          }   I get the following output:  08-09 18:54:08.219 11057-11057/com.piandro D/Zox: 'mp4'  08-09 18:54:08.219 11057-11057/com.piandro D/Zox: 'mp4'  08-09 18:54:08.219 11057-11057/com.piandro D/Zox: FU  08-09 18:54:08.219 11057-11057/com.piandro D/Zox: 'mp4'  08-09 18:54:08.219 11057-11057/com.piandro D/Zox: 'mp4'  08-09 18:54:08.219 11057-11057/com.piandro D/Zox: FU  08-09 18:54:08.229 11057-11057/com.piandro D/Zox: 'mp3'  08-09 18:54:08.229 11057-11057/com.piandro D/Zox: 'mp3'  08-09 18:54:08.229 11057-11057/com.piandro D/Zox: FU  The key code part is:              String ext = "";              ext=getFileExtension(ff);             Log.d("Zox","'"+ext+"'");             if(ext!="mp4"){                 Log.d("Zox","'"+ext+"'");                 Log.d("Zox","FU");             }             else {                 fls.add(new Item(ff.getName(), ff.length() + " Byte", date_modify, ff.getAbsolutePath(), "file_icon"));             }   and condition and action are nonsense, just for debugging purpose. Why Java doesn't recognize String match?


I have a table QUEST which will have  some columns like(id, difficulty, description, etc). Also there are some particular quests that will have specific columns. In Java I will make particular quest to extend Quest. But, how is it better to save this in the database? Given the fact that I will be using Hibernate. My options are:   Table Per Hierarchy, where I have a single table, with nullable  columns Table Per Subclass, where I have a table for every class.   Suggestions? Also, in my app, many CRUD operations on those quests are expected