foo.stackexchange.com should redirect appropriately

What should happen if you type one of the following URLs into your browser?          ...because this is what you get:


How to check if a file exists before writing to it

Fairly self explanatory, how do I check to see if a file exists before I write to it in C.


After some changes (I do not remember what I change) my system (lubuntu) does not automatically boot in graphical mode. After system start I have to log in (in text mode) and after that type "sudo startx" command graphical interface starts.  I would be grateful if somebody could help me deal with that problem.  Best regards,  patlas


Occasionally, when running xelatex (using TeX Live 2018 on Linux Mint 19.2), I encounter the following error message:  (/usr/local/texlive/2018/texmf-dist/tex/latex/microtype/mt-cmr.cfg)) (/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/se-ascii-print.def) [1 ! I can't write on file `xxx.pdf'. (Press Enter to retry, or Control-D to exit; default file extension is `.pdf') Please type another file name for output:   This happened to me yesterday evening, and I found myself expending an hour of my time trying to nail down what could be causing causing such a behavior.  I had a document viewer with the PDF open so naturally that could have been blocking access to the file so I closed the program, but to no avail (I'm using Evince which is most of the time fine, does automatically reload on document update, but has also occasionally been known to become unresponsive for no tractable reason).  I tried then to remove all temporary files and the PDF from the target folder; in my case this included all files matching *.aux, *.fls, *.log, *.out, and *.pdf; this had no discernible effect.  I also tried to write to another target:  (Press Enter to retry, or Control-D to exit; default file extension is `.pdf') Please type another file name for output: /tmp/x.pdf ! I can't write on file `/tmp/x.pdf'. (Press Enter to retry, or Control-D to exit; default file extension is `.pdf')   This did not spark joy.  During my continued efforts to come to grips with this I could produce a PDF roughly one out of two or three runs; I was unable to make the behavior predictable—it's not the viewer, it's none of the existing files in the directory, all packages that are loaded are always the exact same ones.  Has there been any experience as to possible reasons for failure to write to the target or any other file? If the specific target had been blocked, then surely entering a non-existing filename in the existing /tmp directory should always work, right? It feels as if the 'file writing mechanism' of TeX has a washer hopping around in the gear, sometimes causing it to grind to a halt.  I will say that this work is being done on a recent but not terribly performant netbook, IOW it might be the case that shortage of RAM is the underlying problem and failure to write just the visible side effect of that. Maybe someone can corroborate or refute that; personally I would of course prefer any software to fail with an Out of Memory error when that is indeed the problem.


animals = ["dog","cat","lion","elephant"]  animals[-1:-3]  What is wrong with this? Gives me blank result


How do I install Minecraft Forge for Windows 8.1?

I just bought a new gaming laptop, the ASUS Republic of Gamers series, built to be all beefy for my gaming needs.    I am trying to add mods for Minecraft but when I try to download Minecraft Forge, it doesn't open up like it should. I've done it on other computers and it works fine but I believe it's because I have Windows 8.1 and I have no idea what I am doing.    What should I do and how do I get Forge and mods for Minecraft?


How to correctly mention 'Ranked 1st in undergraduate class based on GPA' on CV?

I recently graduated with the highest GPA in my undergraduate class of 350 students. My current CV reads -  GPA: 3.x/4 (Ranked 1st out of Undergraduate Class of 350 students)  However, this feels slightly forced and awkward. Is there any better way to write this?  Thanks!


In Crontab generic way to specify every n mins where n > 60

In crontab, i have seen a couple of answers where users have requested a way to run every 5 mins:  */5 * * * * command   Or every 5 mins with an offset:  10-59/5 * * * * command   An i have seen some creative solutions where people have made 2 line crontabs for every 90 mins:  0 0-21/3 * * * whatever 30 1-22/3 * * * whatever   Thanks to one of the answers below (thanks @khaled), here is another creative solution to 3h30mins:  0 0-23/7 * * * whatever 30 3-23/7 * * * whatever   Is there a generic solution to the every x mins problem? For example I currently need every 3h30m.   To address the duplicate tag: The question linked is clearly different - there is general advice on how to setup and debug cron jobs. I am referring to a specific problem where we are reaching the limits of the cron syntax. I am looking for a general algorithm for solving the "every greater than 60 mins" problem, which is not addressed in the linked question.


How to interpret the result of Fisher's unit root test

Following are the results from Fisher-type unit-root test for RDI (dependent variable). How do you interpret it?   Based on Phillips-Perron tests:  Ho: All panels contain unit roots           Number of panels       =    100 Ha: At least one panel is stationary        Avg. number of periods =  10.74  AR parameter:    Panel-specific             Asymptotics: T -> Infinity Panel means:     Included Time trend:      Included Newey-West lags: 1 lag                                       Statistic               p-value  Inverse chi-squared(196)     P       207.1519                 0.2788 Inverse normal               Z        2.0005                  0.9773 Inverse logit t(389)         L*        0.5211                0.6987 Modified inv. chi-squared    Pm        0.5633                 0.2866  P statistic requires number of panels to be finite. Other statistics are suitable for finite or infinite number of panels.


The radian is defined as the ratio of the circumference and the radius. Both are measured in meters. So there should not be a unit for that. But we use 'rad' as the unit of the radian value.   The coefficient of static/kinetic friction also the same, it is a ratio of both forces. Therefore it doesn't have a unit.  So, is there a special reason to have a unit for the radian value?


Do angular conditions work the same way as pure javascript?

I wonder if there is the same difference between identity === and equality == operators in angular directives like in pure javascript?  For example is  ng-if="value === 'foo'  better than  ng-if="value == 'foo'  What I checked is that   ng-if="true == 1  passes but   ng-if="true === 1  doesn't, so it looks like it works the same way like pure js. On the other hand in angular source they use just equality check, even tho in js identity is preferred.    Which operator should we use in angular directives?  EDIT: To clarify - I'm not asking about javascript conditions, this has been already answered on stack, my question is - is there any difference in conditions between pure js and angular directive conditions?


Assume that X depicts a random variable denoting the time it takes someone to sweep the floor today and Y be the time it takes him tomorrow and Z be the time it takes him on the last day of October.   If X, Y and Z are assumed to be independent, it means that the person does not "learn" how to sweep faster through his first day's experience and the result of X is irrelevant to the result of Y and Z.  What does it mean physically when X,Y and Z have a correlation coeffecient of a certain amount (say 0.5).   I understand that $\rho_{XY} = \dfrac{cov(X,Y)}{\sigma_X \sigma_Y} = \dfrac{E[(X-\mu_X)(Y-\mu_Y)]}{\sigma_X \sigma_Y} $


Unable use countability argument in following problem

Suppose f is analytic function defined everywhere in $\mathbb C$ and such $z_0\in \mathbb C$ at least one coefficent in expansion    $f(z)=\sum^\infty_{n=0}c_n(z-z_0)^n$ is equal to $0$. Then prove that $f$ is polynomial   I understood that for each $z\in \mathbb C $ there exist some $n\in N$ such that $f^{(n)}(z)=0$ There is hint available for this problem says that use countability argument . I know that zero of holomorphic function is at most countable by Identity theorem. Here we get each $z$ some $n$. It does not say about for all $n$ some $n$ exist . I am not able to use hint. Any Help will be appreciated


Suppose we have a data set with a binary outcome variable $y$. The predictor variables are $x,w$ and $z$. This is the training data set. We obtain a logistic regression model from this training data set. Now suppose we have a test data set and want to predict $y$. In R, we use the  predict  function to do this. But we end up with predicted probabilities instead of $1$ or $0$. How would we convert the probabilities to either a $1$ or $0$?


How often must an irreducible polynomial take a prime value?

Suppose $f(x)$ is an irreducible polynomial over $\mathbb Z$ of degree $n$. Is it always the case that there exist distinct $x_1,\ldots,x_{2n+1}\in \mathbb Z$ such that $f(x_1),\ldots,f(x_{2n+1})$ are all prime?  So far I've tested a few irreducible polynomials using mathematica, and this has held. The motivation is to use this as a test for irreducibility, as if $f(x)$ is not irreducible then it takes on at most $2n$ prime values, as either factor takes on $1$ or $-1$ at most $2n$ times. (I'd also be interested in learning if this bound can be improved).  This could potentially be expended to other rings of integers, i.e. $\mathbb Z[i]$, but in that case the minimal number of primes needed to certify that $f(x)$ is irreducible would increase as more units appear.


I do not know why, but it seem that the tikz and  pstriks packages are in conflict. Using both   \usepackage{tikz} \uspepackage[usenames,dvipsnames]{pstricks}   When compiling, it returns me the following error:     !No room for a   new \dimen   I list below the packages that I used:  \documentclass[a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{color} \usepackage{epsfig} \usepackage{booktabs} \usepackage{MnSymbol} \usepackage{array} \usepackage{makeidx} \usepackage[all,dvips,graph]{xy} \usepackage{hyperref} \usepackage{tikz} \usepackage[usenames,dvipsnames]{pstricks}    Note that without one of tikz or pstricks, it will compile.


Is there an easy way to create ordinals in C#?

Is there an easy way in C# to create  for a number? For example:   1 returns 1st 2 returns 2nd 3 returns 3rd ...etc   Can this be done through String.Format() or are there any functions available to do this?


Wordpress Astra archive page: chronological numbering w/ reverse-chronological display ordering?

On Wordpress using the Astra theme I have archive pages containing titles and excerpts from 10 blog entries each, and when a new blog entry is written its title and excerpt go to the front. So the front archive page always has titles and excerpts from the 10 most recent blog entries, and the archive pages are arranged in reverse chronological order. This is pretty standard.  The problem is that the archive pages are not only ARRANGED in reverse chronological order: they are also NUMBERED in the same order. Thus the front page is labelled page 1, and the 10 entries posted BEFORE its 10 entries are on page 2. Correspondingly, “next page” refers to the next higher number. So for example the “next page” after page 7 contains excerpts from the 10 articles posted BEFORE the articles that are excerpted on that page.  I need the numbering to be the other way round.  For example if there are 117 entries than I want the page referring to the most recent entries (the 108th to the 117th) to be called page 12, and the previous page to that one (referring to the 98 the to 107th) to be called page 11.  This isn’t such a peculiar thing to do. It’s how issues of periodicals are numbered, for example.  How can I achieve this, whether by amending functions.php in the child theme (preferably), by writing a “Snippet” (next most preferred), or by amending archive.php in the Astra parent theme directly (least preferred, because of possible update problems)?  I know how to renumber the posts into direct chronological order, namely using the following PHP code. But unfortunately this DISPLAYS them in numerical order, which has now been reversed. So it causes the earliest posts to be excerpted on the front archive page rather than the latest ones!  <?php  add_filter(‘pre_get_posts’, ‘posts_by_forward_date’);  function posts_by_forward_date($query) { if(is_archive() || is_home()) { $query->set(‘order’, ‘ASC’); } } ?>   Any help will be much appreciated!


Java style guide, why should you do single class imports?

In  they suggest to always use Single class imports, but they don't give a reason. What are the reasons to adopt this style of importing single classes instead of *?  Also, side question, how to I set up IntelliJ to optimize my imports in this fashion?


Average distance between two random points in a square

A square with side $a$ is given. What is the average distance between two uniformly-distributed random points inside the square?  For more general "rectangle" case, see . The proof found there is fairly complex, and I am looking for a simpler proof for this special case. I expect it could be significantly simpler.  See also .


Java access control for protected field outside package

I was given a question to determine whether the following access is legal.  package SomePack;  public class A1 {     ... protected int y1; }  ///////////  package Whatever; class B2 extends A1 {     void h(SomePack.A1 x) {         x.y1 = 3; // Is this line legal?     } }   I thought it's presumably legal since  1. y1 field is protected 2. B2 extends A1 so B2 is a subtype of A1.  3. Access control is based on static type and the static type of x is A1.  But the interviewer said the answer should be illegal. Anyone could help explain this? Many thanks.


Understanding a statement about equivalent norms ($||\cdot ||_2 \sim||\cdot||_1 $)

I am trying to understand the following statement from an analysis book:     Two norms are equivalent ($||\cdot ||_2 \sim||\cdot||_1 $) if they   induce equivalent metrics.   At first I thought this was straight forward but then the book has the following proposition that leads me to believe that I have a misunderstanding:     Let $||\cdot||_1$ and $||\cdot||_2$ be two norms on a field F. Then   $||\cdot ||_2 \sim||\cdot||_1$ iff there exists a positive real number   $\alpha$ such that $||x||_2=||x||_1^\alpha , \ \forall x\in F$.   How can it be that $||x||_2=||x||_1^\alpha$ if x is any other value other that 1 if $\alpha\ne$1? Maybe this is related to my misunderstanding... can norms and metrics be thought of as the same thing? Thanks!


Two close prepositions; how do you not end with one?

I've always had difficulty ascertaining the way to approach structuring a particular type of sentence re: the situation in the question title.   There are probably all sorts of ways to restructure this particular example in such a way so as to avoid the issue entirely, but unless that is, in fact, the general rule of thumb in these types of situations, I want to make sure we focus on the specific concept of dealing with two prepositions of this type rather than just dealing with the no doubt poor example. As follows:     "...the value of which, I might add, humans are completely delusional about."   What I want is to stick that "about" somewhere that is not the end of the sentence.  As I have done for "of", I know we often use "which" to make sure that our prepositions don't end up at the end of our sentences.    In the above example, if it was "the thing" that humans were delusional about, it would be easy to just end it with "[the thing], about which humans are delusional."  But instead, it's "the value OF the thing" about which humans are delusional.  So if I wanted to structure the sentence more or less like I've done, coming at the end of a larger monologue, as sort of an afterthought, I'm not sure how to squeeze the "about which" in there with the "of which" that's already there.  For instance, could I double use the same "which" somehow?  Or must I slide a second "which" in there to use with the "about"; if so, in what order should it go, exactly?    Note:  I realize that with this example, I could easily just add the words "is something", so as to say:  "...the value of which, I might add, is something about which humans are delusional."  But again, I want to focus on dealing with this concept in all contexts, rather than avoiding it here just because it happens to be easy.  (Also, even that sounds a bit repetitive to my ear, what with the two "which"s so close to each other.  The "I might add" is really there to try to add some separation but it isn't all that effective.)  This has been on my mind before more than once, and, if I recall correctly, I'm pretty sure I once heard Frasier Crane solve this for me with some fancypants word magic in exactly such a situation, and it sounded great. I want to say he somehow doubled down on a single "which"; something like "of about which".  The problem is that that doesn't really seem right to my ear when I try it now, but I can't for the life of me remember or figure out how else he might have done it.  Thanks in advance to anyone who will help scratch this itch.


I use amazon EC2 instance which works via ubuntu. By default according security restrictions I can't bin my application to port 80, so I just bind it port 8080 and then set routing redirect from port 80 to 8080 via the following command:  iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080   But I found that when I reboot the server this settings no longer active untill I invoke this command again.  So my question is how to enable port's redirect work even if system was rebooted?


Simple name server alternative a la /etc/hosts

I use /etc/hosts to define names to local addresses in the network, so I can type ssh user@raspberry instead of ssh user@192.168.0.5.  It works very well for a single machine, but now I need to replicate to many machines. So naturally, a central name server in the server is a better approach, so I configure the machine once and the changes are all made in the server.  The question is: Whats the better way to implement this? I want to to keep it simple, just like using the hosts file, and something like BIND seems to be a little overwhelming. And what the pros and cons of a certain approach?


Which one of each is correct?    A1 - He asked a simple question about the use of articles. vs A2 - He asked a simple question about use of articles.    B1 - All universities in Vancouver are amazing.  vs B2 - All of the universities in Vancouver are amazing.


How do I get the title of the current active window using c#?

I'd like to know how to grab the Window title of the current active window (i.e. the one that has focus) using C#.


Remove bad sectors on a hard disk in Windows 10

My old laptop has become utterly slow and unresponsive to the extent that after loading it takes a good 30-40 mins before I can even use it. It's mostly in an unresponsive state and doesn't change even if I do a hard restart. I did a SMART test and it shows my hard disk is 58% healthy.   I read somewhere on a forum that the OS or the NTFS disk itself will mark bad sectors and wouldn't write to them. So my question is, my disk is 750 GB, 58% of which is 435GB. My total data on the disk is roughly 300 GB. But I think the hard disk may still be reading/writing to those bad sectors and thus my system is not responsive. So my question is, can I do something in order to block all those bad sectors and use the left over good sectors only ? Most importantly, will it be a good idea in first place or should I just replace the old hard drive?   Note: This is an old computer and I only use it occasionally to stream movies on my tv via hdmi.


Rules to determine "unforced errors" and "winners" in tennis?

Is there any rule to understand when a shot is an "unforced error" or a "winner" in a objective meaning?


Java: Make a String Integer if it is an Integer

I Have an JOptionPane that I want to convert to integer, but only if it actually is an integer the user inserts. How do I do this? if-statement?


What does Dolores Umbridge lack in her personality?

We know from  that Dolores Umbridge has a very short wand:     Wand: Birch and dragon heartstring, eight inches long   Also, that short wands tend to choose wizards with something lacking in their character/personality.     Most wands will be in the range of between nine and fourteen inches.   While I have sold extremely short wands (eight inches and under) and   very long wands (over fifteen inches), these are exceptionally rare.   In the latter case, a physical peculiarity demanded the excessive wand   length. However, abnormally short wands usually select those in whose   character something is lacking, rather than because they are   physically undersized (many small witches and wizards are chosen by   longer wands). -    We know for sure that two things Umbridge lacks is empathy (she is really sadistic) and good taste (here I'm translating from German, I hope it means what it is supposed to mean!).  Now my speculation: because of her narrow world view and because of the way she seeks and uses power, I had the impression that she must also be lacking self-esteem and/or self-confidence. It's common that people become narrow-minded and power-seeking (not necessarily to the extent Umbridge does) among others because of that.  Is there any more information on this issue?   Edit: as Hellothere_1 pointed out, bullies have actually high self esteem. Hovewer some people with low self-esteem might become among others , so I guess I somehow mixed both 'traits'.


I have some doubt regarding what the size of a self referential structure in C is. I ran the following code and it gave me a output of 24  #include<stdio.h>  int main() {      struct hello {               int a;         char ch[10];         struct hello *p;     } dhiraj;      printf("%d",sizeof(struct hello));     return 0; }   Now next I modified the index of ch and made it 20 the next time and after running it gave on output of 32  The other weird behavior which I noted was that after the execution of the following code -   #include<stdio.h>  int main() {      struct hello {         int a;         // int b; Statement 1          // int c; Statement 2         struct hello *p;     } dhiraj;      printf("%d",sizeof(struct hello));     return 0; }   I got an output of 16. After activating statement 1 the output was still 16 but after activating both statement 1 and statement 2 the output became 24. What is actually happening here ?


How do I format a number in Java? What are the "Best Practices"? Will I need to round a number before I format it?  32.302342342342343 => 32.30 .7323 => 0.73  etc.


I would like to pass two variables to my SOQL Where clause.  Can someone give me an example how this is done in Apex.  My objects are custom objects.  Variable1 Variable2  Example in SQL:   'Select Id, FirstName, Lastname from Object1 where FirstName like ' & Variable1 & ' OR Lastname Like ' & Variable2 & ';'   Thanks


How to add default icon in Qt widget application

I am trying to develop a simple qt app, I would like icon for the toolbar buttons, How can I standard icons for these toolbar buttons, new,open,close etc


How can the equality below hold? If I have a maximally entangled qudit state $\lvert \Phi\rangle_{AB}$ and any $d\times d$ matrix $M$, then it is claimed that  $$ (M_A\otimes I_B)\lvert \Phi\rangle_{AB} = (I_A\otimes M_B^T)\lvert\Phi\rangle_{AB}$$  I can see that this works for qubits and using the Pauli spin operators, but I am not seeing it in the general case.


I can't figure a way to work this one out, I know it has to go to 1. this is the best I could do:   $0^0$ $\le$ $n^\frac{-1}{\sqrt{n}}$ $\le$ $n^\frac{1}{n}$   but I feel like that's cheating. It is causing problems because $n^\frac{1}{\sqrt{n}}$ $\ge$ $n^\frac{1}{n}$ and $n^\frac{1}{\sqrt{n}}$ $\ge$ $n^\frac{-1}{n}$. so I can't find a way to sandwich it for squeeze theorem.   I know of the Binomial expansion trick for $n^\frac{1}{n}$ but that gives two lower bounds since $n^\frac{1}{\sqrt{n}}$ ≥ $n^0$ and  $n^\frac{1}{\sqrt{n}}$ ≥ $n^\frac{1}{n}$ ? since n ≥ $\sqrt{n}$ => $\frac{1}{\sqrt{n}}$ ≥ $\frac{1}{n}$. I can't seem to find a upper bound I know converges to 1


Can a South Korean citizen visiting Canada travel to the United States?

My friend from South Korea is visiting me in Canada (she is not a Canadian citizen). Is it possible for her to get an ESTA (Electronic System for Travel Authorization) while in Canada, and then visit the U.S. with me by driving across the border?


Unable to update packages in KUbuntu 18.04

I made a fresh install of KUbuntu 18.04 and now when I try to update packages using sudo apt-get update I get the following error  E: The repository 'http://ppa.launchpad.net/docky-core/stable/ubuntu bionic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.


I was using this guide and changed a lot of pmset settings duo of FileVault2    Is there any option to restore the factory defaults?


My computer becomes extremely slow and I see the hard disk accessing as if someone was taking backup. How can I see what instruction my computer is executing? I am using Ubuntu 20.04 LTS 64-bit on an HP Intel i3 computer, 1.5 TB hard drive, 4 GB RAM.


How do you loft between curves in Blender. I am finding tutorials on the subject but they seem old and outdated. Is there a current way to do something like that? (In version 2.74)  NOTE: This is not a duplicate post because the answers that were posted are no longer valid. The CurveTools Plugin doesn't seem to work in version 2.74. Has it been replaced with something else?


Are $(x^3)^{1/3} $ and $\sqrt{x^2}$ monomials?    In mathematics, a  is, roughly speaking, a polynomial which has only one term. Two different definitions of a monomial may be encountered:  For the first definition, a monomial, also called power product, is a product of powers of variables with nonnegative integer exponents, or, in other words, a product of variables, possibly with repetitions.   For the second definition, a monomial is a monomial in the first sense multiplied by a nonzero constant, called the coefficient of the monomial.


Securing the PHP code from SQL Injection

I have a PHP site which has a lot of POST and GET variables.  For each of the POST and GET variables on every page I have added as follows:  If I needed only numbers in the [POST/GET] variable...  $post_q_time_post = preg_replace('~[^0-9]+~', '', $_POST["q_time_post"] );   If I needed Text / Numbers ..  $post_oldp = preg_replace('~[^a-zA-Z0-9]+~', '', $_POST['oldp'] );   And then used the stripped variable all over the page.  How secure is my site now? Is it possible to do SQL injection of any other PHP based attack now ? If so, what additional steps I should do ?  Thanks.


How can I dual boot Windows 10, and Debian 8 (with Debian already installed)?

I have Debian 8 installed on my 32-bit laptop, and I want to install Windows 10 on it (because reasons). How can I do that? It meets the minimum requirements, I want it to appear in GRUB, and I want it to not overwrite my Debian installation (obviously).


The exact and best canvas size when creating a logo

Experts,Professionals,intermediate,Beginner!  what is the best canvas size when creating a logo. does not matter if it is inches,cm,pixel just give me some awesome answer and it will be great!  thankyou for your kindness and time for answering my question!


Unable to see edit history of a question by tapping "edited x minutes ago" on Android

On Android se app I am unable to view a post's edit history unless I opt to open the question in the browser.  Clicking on the edit field causes the box to flash light blue, but nothing happens.


Why printing a int static value gives object notation value, instead of actual value

I am trying to print static int value in main method of java, when I am printing it is giving me value as [Ljava.lang.String;@7852e922 as object notation instead of actual value.  Could you please explain what is happening under internally.  Also, when I am trying using ClassName.varibaleName its working and printing correct value. Also, when I am printing using object. it is showing the correct result.  I am seeing the issue only when I am directly accessing the value of static variable in main method.       I also, tried creating other method and it is giving the result.  class Demo1 {      static int a;      public static void main(String a[]) {         Demo1 demo1 = new Demo1();         demo1.inc();         Demo1 demo2 = new Demo1();         demo2.inc();         Demo1 demo3 = new Demo1();         demo3.inc();         System.out.print("Count value is=" + a);         System.out.print(a);         System.out.print("\n" + demo1.a);         System.out.print(demo2.a);         System.out.print(demo3.a);     }      public static void inc() {         a = a + 1;         System.out.println("Value a" + a);     }  }   I am getting below Result:   Value a1 Value a2 Value a3 Count value is=[Ljava.lang.String;@7852e922[Ljava.lang.String;@7852e922 333   But expecting Count value is= 3 instead of [Ljava.lang.String;@7852e922


Finding a primitive root of a prime number

How would you find a primitive root of a prime number such as 761? How do you pick the primitive roots to test? Randomly?  Thanks


How to vertically center align an inline-block element

I know this question has been asked before, but none of the answers have helped me. I have used vertical-align:middle; and line-height:normal; but they don't work. I would like what is inside modal-body div to be vertically center aligned. Thanks for your help. Here is my code:

Please leave your feedback!

     <input type="radio" id="star5" name="rate" value="5" />     5 stars     <input type="radio" id="star4" name="rate" value="4" />     4 stars     <input type="radio" id="star3" name="rate" value="3" />     3 stars     <input type="radio" id="star2" name="rate" value="2" />     2 stars     <input type="radio" id="star1" name="rate" value="1" />     1 star

         <input id="submitfeedback" type="submit" value="Submit">
   #modal {   position: fixed;   top: 50%;   left: 50%;   transform: translate(-50%, -50%) scale(0);   transition: 200ms ease-in-out;   border: 1px solid black;   border-radius: 10px;   z-index: 10;   background-color: white;   width: 600px;   max-width: 80%;   text-align:center; }  .modal-header {   padding: 10px 15px;   display: flex;   justify-content: space-between;   align-items: center;   border-bottom: 1px solid black; }  .modal-body {   padding: 10px 15px;   vertical-align: middle;   line-height: normal; }  .rate {     display:inline-block;     height: 46px;     padding: 0 10px; }


I see that an article "the" is needed to describe the headquarters of the US Department of Defence: The Pentagon.   From my grammar book to show the usage of articles, I found that "the" is not necessary with companies, e.g., Microsoft, nor with major landmarks, e.g., "Central Park". However, "the" is necessary with building names, "the Hilton".  So, "the Pentagon" uses an article "the" to symbolize the building?  In general, is there any good logic behind the usage of "the" with proper nouns?


Beamer: Change only several bullets in the list

I would like to change the bullets in the second itemize to arrows.  \begin{alertblock}{The Aim of this Research}      \begin{itemize}         \item Item 1         \item Item 2             \begin{itemize}                 \item Item 2-1                 \item Item 2-2             \end{itemize}     \end{itemize}  \end{alertblock}   Form above, I would like to make:  ・Item 1  ・Item 2    => Item 2-1  (change bullet to arrow)    => Item 2-2   I've tried inserting \renewcommand{\labelitemii}{$\rightarrow$} before and after the second \begin{itemize} and , but they don't work.


Comparing $\;2^n\;$ and $\;n!\;$  I need to rewrite one or the other so they can be more easily compared (i.e. have similar form). Because of the factorial, I'm a little lost as to how to compare the two functions. Normally, I would take the logarithm when trying to re-express a power like $2^n$, but I don't think this will work, since I don't know how to take the logarithm of a factorial, if at all.   Might the series expansions of either functions be the right approach? If not could, someone point me in the right direction?


Is there a risk of contracting Ebola on a ferry ride from Spain to Morocco?

I will be traveling from Spain to Morocco on the ferry this month, and I'm trying to see how dangerous as far as getting Ebola on this ferry? And are there any safety precautions on this ferry in order for it to be considered safe?


\hbox \mbox difference ... what they do?

What is the difference between \hbox and \mbox?  What are these commands intended to do?  I cannot see what they do from my code alone without a word explanation...


I'm creating my own vector class(for an assignment) here:  private: T *items; int used;  Vector() {     used = 0;     items = new T[1000]; };   When I construct the vector and use:  std::cout<<sizeof(items)/sizeof(T);   It returns 1 always, no matter what size I make items in the constructor(I've tried 1000,4,1,0,-1) it always cout's 1. I also try to double the array when it reaches 1000, then 2000 then 4000 etc.          if(used == sizeof(items)/sizeof(items[0])) {         T *tempItems = new T [used];         memcpy(items, tempItems, sizeof(items));         delete []items;         T* items = new T[used*2];          memcpy(tempItems, items, sizeof(items));          delete []tempItems;         }   It throws an invalid read when I try to print out items's contents. This may be due to the previous problem. I cannot go back to using vector's, that's the point of the assignment.


Ordered binary sequences of length n with no two consecutive 0's without using recursion

Given ordered sequences of 0's and 1's of length n. In how many of them no two 0's stand next to each other? Could you do if n=25.   I know this can be solved by using recursion. I am not familiar with solving recurrence equations. Could this be done another way?


Will Stack Overflow have a close question option once I create a question?


Need more intuition for the curse of dimensionality

People despise using Eucliean distance in higher dimensional spaces because it is not a viable metric. People argue that the distance between two vectors becomes very large as the number of dimensions increases.  But to me: it makes sense as we add more dimensions that the Eucliean distance between two points in high dimensional space becomes larger as we add more dimensions. I don't quite see the problem here.  How does inflating the distance between two vectors invalidate the metirc itself? The magnitude of the distances may be larger, but why can't it still be a viable comparison metric?  The book elements of statistical learning gives a nice picture trying to describe why Eucliean distance fails:    Okay - so what? The distance between two points gets larger and larger? Why does that invalidate the metric? It makes perfect sense that the distance between these two vectors is larger as we add new dimensions because they are more dissimilar to one another in the newer dimensions.  Let's think of an example where we collected lengths of a bunch of toys:   5.3 2.2 1.2   The nearest point for a new toy 4.2 is 5.3 based on Euclidean distance. Now let's add another dimension called width of these toys.   <5.3, 5.6>  <2.2, 2.1> <1.2, 0.4>   An our new point is <4.2, 0>. Now the nearest point is <2.2, 2.1>. This makes sense. Because the second dimension is widely different there. People argue that distances become less meaningful. But I can still successfully apply it here and the resulting distance makes perfect sense to me.  Anyway I don't fully understand this hatred towards Euclidean distance - it seems to make perfect sense to me!


Validation for setter and getter in a class

In this code, I've been trying to figure out my mistake, when I run it the program crashes. It's asking the user to enter a pet gender, if the user enters (F, f, Female or female) it sets the variable as "Female". same for Male.  I feel it's a silly mistake, but I really couldn't find it!   public void setPetGender(String PetGender) {      if (PetGender.toUpperCase().startsWith("F")) //retrun Female if it statrts with letter F, (F,f,Female,female) entered by user.     {         PetGender = "Female";         this.PetGender = PetGender;     }      else  if (PetGender.toUpperCase().startsWith("M")) {         PetGender = "Male";         this.PetGender = PetGender;      } else {         throw new IllegalArgumentException("The gender your entered is invalid, please enter Female or Male only.");     }  }


I am trying to locate a file that (should) contains the string "1896.345", somewhere under /home/dir/.  Any ideas of how I can do it? Thanks


How and when did “give it up for someone” start to mean asking for applause?

I recently attended a meeting where the speaker frequently used the phrase give it up for someone. I understand that this expression means to clap for the person or group mentioned. It is similar to give someone a hand.  Where did this phrase originate? I don’t exactly get why giving it up means clapping.


Rotating symbols per attribute value in QGIS?

I am trying to apply a rule to rotate symbols based on the value of an attribute.  I tried to copy , which is essentially my question, however it does not work for me.   I have a layer with two attributes, the slope and aspect.  I want to colour the symbols by the slope (this part works) and rotate by the aspect.  The steps I take are:   Layer Properties -> Style -> Graduated -> Symbol -> Change Select Simple Marker (arrow) and press the button to the right of angle -> field type (double) -> Aspect-sel    Applying these commands changes the symbol to an arrow, and I can easily apply the colour gradient, but the symbols do not rotate. The attribute Aspect-sel varies from 2.87 to 334.23.    ETA: I was using Version 2.8.3 - on suggestion I updated to 2.14.10, which solved the problem.


Splitting string after specific character in sql

I have for example this string name-surname-15A-15B and for example if I want to get the last segment(which is 15B) I can use the following query:  Select right(Code, charindex('-', reverse(Code)) - 1) as segment From MyTable   But how can I get string after specific dash for example the second one which will return 15A-15B ?


I am traveling to Europe for two weeks from South Africa and the exchange rate is really not in my favour.  Where is the best place to exchange? In South Africa or when I arrive in France?


Why does hair grow after trimming but remains at a constant length after a while?

Some hair especially body hair regrows after trimming but stops growing after a while. What is the mechanism behind control of hair growth and how is the length limit determined?


My APP crashes as soon as launch on Android Emulator on Android Studio

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnClickListener(android.view.View$OnClickListener)' on a null object reference at com.example.converter.MainActivity.onCreate(MainActivity.java:30)   that's where it shows error         btnMiles.setOnClickListener(new View.OnClickListener()


BeautifulSoup4 stopped working on Ubuntu 16.04

Using BeautifulSoup4 on Python3  Fired up my Ubuntu machine and got the following error.  My web scraping script runs BeautifulSoup4 and was working so far.   The only thing I did recently was install Audacity. Don't know how that could affect BeautifulSoup.    Traceback (most recent call last):   File "scrubNprint.py", line 1, in <module>     from bs4 import BeautifulSoup   File "/usr/lib/python3/dist-packages/bs4/__init__.py", line 30, in <module>     from .builder import builder_registry, ParserRejectedMarkup   File "/usr/lib/python3/dist-packages/bs4/builder/__init__.py", line 314, in <module>     from . import _html5lib   File "/usr/lib/python3/dist-packages/bs4/builder/_html5lib.py", line 70, in <module>     class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder): AttributeError: module 'html5lib.treebuilders' has no attribute '_base'   The error from .builder import builder_registry, ParserRejectedMarkup, I have searched my directory list and I don't seem to find the script builder.  The error from . import _html5lib, the file seems to be there in the directory bs4/builder.  I don't understand why I am getting this error.  The last error  class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder): AttributeError: module 'html5lib.treebuilders' has no attribute '_base'   is unclear to me. It appears to be in the script.  More importantly, I did not touch anything that I know of. But I might have done an update before installing Audacity.  However, I don't think updating Ubuntu should have affected BeautifulSoup.  When I do  pip3 --user uninstall beautifulsoup4  I get a message that --user is invalid.    I did pip uninstall, then tried a reinstall.  Still getting the same error messages.  beautifulsoup is installed.   the results of the command you asked for is;  python-bs4:   Installed: (none)   Candidate: 4.4.1-1   Version table:      4.4.1-1 500         500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages         500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages python3-bs4:   Installed: 4.4.1-1   Candidate: 4.4.1-1   Version table:  *** 4.4.1-1 500         500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages         500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages     100 /var/lib/dpkg/status   My python code is correct.  it was working for 5 months.  then, all of sudden I got the traceback error above.  which has not gone away, after deleting and reinstalling beautifulsoup (see .  There is a bug in the current release of the html5lib that causes the error, and it should be fixed in a few weeks.


I need to calculate age in php.  I use this solution:  $birthdate = '1986-09-16';  $_age = floor( (strtotime(date('Y-m-d')) - strtotime($birthDate)) / 31556926);   from   Everything works fine, but for example if  $birthday = '1194-01-06' or   $birthday = '1900-01-01'  result is always 44.   if $birthday = '1910-11-09' everything is fine again and result is 103. Why?  Note: I don't want to use diff() function, because of some issues.  EDIT:   Earlier i had problems with diff(), some      Warning range()   showed during processing and after refreshing of website everything was fine again... i could not find solution to fix it and somewhere i read that using of diff() could cause it. So i tried other solution and it worked... until now.   Finally I used this solution:  $birthDate = from database in timestamp format... $birth = new \DateTime($birthDate); $now = new \DateTime; $age = $now->diff($birth)->y;   and I randomly get  Warning  range(): step exceeds the specified range   again.


What is an equivalent of EXCEPT(in PostgreSQL) in MySQL?

I want to find out unmatched records of two tables in MySQL.


Is it possible to run Snow Leopard on a LATE 2011 MacBook Pro?

I want to buy a new MacBook Pro, from Apple. However I want to run Snow Leopard instead of Lion.  I did some Google searches and found a few success stories of people who got SL to run on their early-2011 MBPs. I didn't find much of any experiences of people doing the same on a late-2011 MBP though, so I'm wondering (and really hoping!) if it's possible?


i want to write this code( java ) on c# , but receive this error message  Unable to cast object of type 'System.SByte[,]' to type 'System.SByte[][]'.  java code is :  byte[][] bArr2 = (byte[][]) Array.newInstance(byte.class, new int[]{2, 8});    my csharp code is   sbyte[][] bArr2 = (sbyte[][])Array.CreateInstance(typeof(sbyte), new int[] { 2, 8 });    thanks


How can I fix the Skype (and the Franz) tray icon not showing up properly?

System specifications:   Ubuntu 16.10 Unity skype 4.3.0.37-0ubuntu0.12.04.1 Franz Version: 4.0.4 Build: 40 Release: 1.3.1 / linux / x64 skype-bin:i386 4.3.0.37-0ubuntu0.12.04.1 sni-qt 0.2.7+15.10.20150729-0ubuntu1 sni-qt:i386 0.2.7+15.10.20150729-0ubuntu1   Other observations:  Besides Skype, the same propblem occurs with .  Screenshots:


App doesn't show my upvote, so I upvote -- and now it's "locked in"

To reproduce:   upvote an answer with 0 current votes edit the question   Expected behavior: answer shows 1 vote Actual behavior: answer shows 0 votes  You will know that the server already received your upvote because if you  upvote again it will say that your vote is locked in.   App Version: 1.0.85 Device Manufacturer: LGE Device Model: Nexus 4   OS Version: 5.1.1 (2237560)


Removing a char from String, what's a more efficient way to do this?

I'm currently studying Python 2.7 from an online course. One of the problems is I have to remove a char from a string based from a list of chars.  What I did was:  def getAvailableLetters(letters):      alphabet = string.ascii_lowercase     reduced_alphabet = ''      for char in alphabet:         if char not in lettersGuessed:             reduced_alphabet += char      return reduced_alphabet   I've learned that there's no such thing as a string method to directly remove a char from a string as they are immutable, so I came up with this. I've successfully submitted a correct answer, but I'm not quite satisfied with it as I feel like there's a more efficient way to do it.


Showing Intermediate Value Property Holds

Let $$f(x)=\begin{cases} \sin \tfrac 1 x &\text{if $x\ne 0$}\\ 0 & \text{if $x = 0$.}\end{cases}$$ I have to show that $f$ has the intermediate value property. That is, for any $a < b$, if $y$ is any real number such that $f(a) < y< f(b)$ or $f(a)>y> f(b)$, then there exists a $c \in (a,b)$ such that $f(c)=y$.  I feel like I kind of know how to go about completing this. I just am curious as to if I have to create a bound such as letting $a = -1$ and $b = 1$, or keep $a$ and $b$ both arbitrary.


Can I use "First, ... Secondly, ... Finally, ... " like this ?

I would like to say :  First, I would like ... Secondly, I am ... Finally , I think ...  is it correct ? and what we call this kind of structure ? is there alternatives ?


Am I allowed to bring an unopened wine bottle in my carry-on luggage onto an airplane?

I am aware that many airports have duty-free shops which sell liquor. Obviously, if you are allowed to buy liquor at an airport duty-free shop, you should be able to carry the liquor on the airplane to your intended destination.  However, can I buy a 750 ml wine bottle not from the airport duty-free shop, but say from the supermarket, and bring it on board an airplane in my carry-on luggage? Or do I have to check-in my wine bottle?


Is it possible to completely reset an iPhone so its software/firmware is guaranteed to be 100% factory fresh?

When purchasing a used iPhone with a completely unknown history (which includes the possibility of multiple previous owners), is it possible to reset it and be sure that all software and firmware on it is 100% identical to the factory image? Please keep in mind that since the history is unknown, it's possible the device was previously jailbroken/unlocked/rooted/etc. If the answer varies depending on iPhone model, please indicate to which models your answer pertains. I'm interested in answers for all iPhone models.  Please note: The question and answers at  do not help because they do not take in account the possibility of the phone being jailbroken/unlocked/rooted/etc.  Also, that question is ambiguous as to whether or not it applies to both the software and firmware.


Use a helper method on a interpolated string

I am looking to see how I would set up my :notice to incorporate a helper method, at the moment I have this and get 'undefined method to_dollars':  notice: "Thank you for your payment of #{to_dollars(amount)}"   Controller  def create   @donation = @campaign.donations.create(donation_params)     if @donation.save_with_payment       amount = @donation.donation_amount       redirect_to @campaign, notice: "Thank you for your payment of #{to_dollars(amount)}"     else      flash[:notice] = @donation.errors      render :new   end end   My helper method is simply (unless anyone has a better way of doing it)  def to_dollars(amount)   convert = amount / 100   number_to_currency(convert, unit: "&#36;", separator: ".", delimiter: "") end   All donation_amounts are saved in cents so just want to convert them to dollars.


Why is the transaction log file not truncated though its simple recovery model?

My database is simple recovery model and when I view the free space in log file it shows 99%. Why doesn't my log file truncate the committed data automatically to free space in ldf file? When I shrink it does shrink. Please advice. I saw this question, . But unlike that scenario I have a simple recovery model and my transactions seemed to have committed as there are no on going transactions and shirkable size is shown as 99%


How do I shade this area using pgfplots?

Hello I am new to Latex and I was wondering how I can shade in the area that I have coloured in green? I would also like to make all the points surrounding it the same colour. I have attached my code that I have so far. Thanks \begin{document} \begin{tikzpicture}[>=latex]  \begin{axis} axis lines=middle, xlabel=\(x1\), ylabel=\(x2\), xmin= -1, xmax=5, ymin= -1, ymax=10, every axis plot/.style={very thick},             ] \addplot coordinates { (0,9) (3,0)}; \addplot coordinates { (0,5) (10/3,0)}; \addplot coordinates { (0,4) (4,0)}; \node[circle,fill,inner sep=2pt] at (axis cs:0,0) {}; \node[,circle,fill,inner sep=2pt] at (axis cs:2,2) {}; \node[,circle,fill,inner sep=2pt] at (axis cs:8/3,1) {}; \node[,circle,fill,inner sep=2pt] at (axis cs:3,0) {}; \end{axis} \end{tikzpicture} \end{document}`


I'm brand new to blender - how do I add a texture to a specifically shaped object

I just started learning Blender yesterday (via blender guru's doughnut), so I'm pretty new to this, though I have some experience using Maya in college. That was a few years ago so I'm pretty rusty in all regards. I decided to try making something on my own now and I thought that the blockbuster sign would be fun to design.   I have the shape all finished, now I just need to slap the decal on there that says "Blockbuster" - and this is where I'm running into trouble. I'm sure this is absurdly easy but I can't figure out how to get this image onto my model. I've been searching for a video to find out how to do this for like an hour with no luck. If anyone could point me in the right direction, that would be great!


How to convert API timestamp into python datetime object

I am getting the following string from an API call:  s = '2014-12-11T20:46:12Z'   How would I then convert this into a python object? Is there an easy way, or should I be splitting up the string, for example:  year = s.split('-')[0] month = s.split('-')[1] day = s.split('-')[2] time = s.split('T')[1] ...etc...


What is the appropriate way to handle questions highlighting an ineffective approach?

What should be the appropriate reaction when someone ask for help, but the question shows major flaws in the code or design? I have the feeling that just "answering" is like helping them to go further in the wrong direction.  Here is a concrete example:   The OP asked about a "SELECT that don't work". The approved answer solved the issue. But, as someone noticed in a comment the code has severe security implications. And there is several like that every days.  In order to provide an helpful, clearly identifiable, and appropriate/polite comment, is there a "repository" of standard comments for these cases? If not, we should think of it.


\ifmmode doesn't seem to work correctly inside an array environment

I’m struggling with getting \ifmmode to work correctly when used inside an array environment which is inside a displaymath environment.  Here is a minimal example:  \documentclass{article}  \newcommand{\signal}[1]{%   \ifmmode     1#1   \else     2$#1$   \fi }  \begin{document} \begin{displaymath}   \begin{array}{cc}     \signal{a} \signal{b} & \signal{c} \signal{d} \\   \end{array} \end{displaymath} \end{document}   This example generates the following output:        Why doesn’t all invokations of \signal detect math-mode?


i have downloaded the jdk file having the tar.gz extension.I am using a 64 bit pc.but i don't understand how to install the javac compiler and how to set the path in Ubuntu 15.04.if anyone can give me step by step process please.


We say 'in the morning' but 'on weekdays' - why?

"I get up late in the morning"  --- In this sentence we have used 'in' before morning   "I get up early on weekdays" --- In this sentence we have used 'on' before weekdays.    Please let me know why we use 'on' for 2nd sentence and why we used 'in' for 1st sentence.


Trigger Setup Wizard at next boot using command-line

I am looking for a way to use ADB to trigger Setup Wizard at next boot. I know I can run the following command and get it to pop up. However, I can't figure out what triggers it to start at boot.  adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity   The phone I am currently using is stock and I would like to keep it that way.   I've read the  question:


Is it possible to determine the slit a photon went through in the double slit experiment by measuring its flight time?

In the double-slit experiment, quantum mechanics states that if you try to determine which slit the photon goes through, you won't have a resulting wave pattern.  But, knowing the time it took for the photon to go from the source to the observing screen, can you deduct the distance of the photon path and so which slit it passes through (except if the photon impacts the exact middle of the observing screen)?


Why does this switch case need braces in c++?

So its been like 12-14 years since I have done any c++ development and this weekend I decided to give it a try again to prototype some gaming stuff but this error was the first one that I ran into that made no sense to me.  I had this switch statement:  void Game::handleEvents() {   SDL_Event event;   SDL_PollEvent(&event);    switch (event.type)   {   case SDL_MOUSEMOTION:     bool mouseInUiNow = isInRect(sideUiBackground, event.motion.x, event.motion.y);      if (mouseInUiNow && !mouseInUi)     {       std::cout << "mouse enter ui" << std::endl;       mouseInUi = true;     }     else if (!mouseInUiNow && mouseInUi)     {       std::cout << "mouse exited ui" << std::endl;       mouseInUi = false;     }      break;    default:     break;   } }   Which resulted in this error:  error: cannot jump from switch statement to this case label default:   After googling a little, I figured out that I needed to add braces around the case statement:  void Game::handleEvents() {   SDL_Event event;   SDL_PollEvent(&event);    switch (event.type)   {   case SDL_MOUSEMOTION:   {     bool mouseInUiNow = isInRect(sideUiBackground, event.motion.x, event.motion.y);      if (mouseInUiNow && !mouseInUi)     {       std::cout << "mouse enter ui" << std::endl;       mouseInUi = true;     }     else if (!mouseInUiNow && mouseInUi)     {       std::cout << "mouse exited ui" << std::endl;       mouseInUi = false;     }      break;   }    default:     break;   } }   However I was not really able to understand why. Knowing how to fix it is one thing but I would really like to understand the why too.  Could someone please explain to me why this is needed in this case but in other cases the braces are not needed (naively is seems like the creation of a variable bool mouseInUiNow = isInRect(sideUiBackground, event.motion.x, event.motion.y); is causing the braces to be needed, but not sure why)?


How were dead men converted into wights weeks after encountering White Walkers?

In , Jon Snow and Jeor Mormont come across two dead rangers. The rangers were dead for weeks and once accompanied Jon's uncle, Benjen Stark.  After Jon and Jeor bring the men's bodies back to Castle Black, one of the bodies reanimates into an ice zombie. Jon runs it through with a sword, but that eventually destroys it with fire.                                  Sam read that corpses touched by the White Walkers are reanimated and can only be killed by fire.  Why weren't the corpses converted to wights minutes after being killed by White Walkers? Why did it take them weeks to reanimate?  Edit to add: The other question linked to this one asks if dead bodies can become wights south of the wall, while this one asks if they become wights weeks after White Walkers touch them. That one is about the location of becoming a wight, and this one is about time since being killed and transformed by a White Walker. Close, but not a duplicate. :-)  Please give citations from the books if you can. I consider the books a higher canon than the TV series.


Append list gave out different result to print result

My python code is just try to print all the permutation of a given list (num in my code). Here is my code  #!/usr/bin/python3              def permutation(list_num, checked_length, length):             if checked_length == length - 1:                 print(list_num)             else:                 for i in range(checked_length, length):                     list_num[i], list_num[checked_length] = list_num[checked_length], list_num[i]                     permutation(list_num, checked_length + 1, length)                     list_num[i], list_num[checked_length] = list_num[checked_length], list_num[i]           num = [1, 2, 3]         permutation(num, 0, len(num))   It gives out the result as i want to  [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 2, 1] [3, 1, 2]   but when i try to change just a little. I want the output of that code to store in Answer_list. I got this unexpected result:  [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]   Here is my code that got the result:          #!/usr/bin/python3     Answer_list = []     def permutation(list_num, checked_length, length):             if checked_length == length - 1:                 Answer_list.append(list_num) # change here             else:                 for i in range(checked_length, length):                     list_num[i], list_num[checked_length] = list_num[checked_length], list_num[i]                     permutation(list_num, checked_length + 1, length)                     list_num[i], list_num[checked_length] = list_num[checked_length], list_num[i]   num = [1, 2, 3] permutation(num, 0, len(num)) print(Answer_list)


I have a directory full of images:  image0001.png image0002.png image0003.png ...   And I would like a one-liner to rename them to (say).  0001.png 0002.png 0003.png ...   How do I do this?


Ever since I upgraded to 19.10, when I close the lid the laptop doesn't suspend anymore. It doesn't even lock the screen. It almost seems like the OS isn't picking up the close lid event. If I press the power button suspend works fine and resumes when I open the lid afterwards.  I have the 'suspend when lid is closed' option enabled in GNOME Tweaks.  Any idea on how to fix/debug this issue? I have a Dell XPS 15 9560.


Can a $N-1$ rectifiable set be partitioned into countably many connected pieces?

Let $\Gamma\subset \mathbb R^N$ be a $N-1$ rectifiable curve such that $\mathcal H^{N-1}(\Gamma)<\infty$. I am wondering that would it be possible to partition it into countably many connection pieces, up to $\epsilon>0$ error? (where $\epsilon>0$ is given)  That is, would it be possible to find a set $\{\Gamma_n\}_{n=1}^\infty$ such that each $\Gamma_n\subset \Gamma$ is connected, and  $$ \mathcal H^{N-1}\left(\Gamma\setminus \bigcup_{n=1}\Gamma_n\right)<\epsilon. $$    My try: I simply think there can not be uncountably many connected pieces with positive $\mathcal H^{N-1}$ measure, otherwise  $$ \sum_{n=1}^{\infty} \mathcal H^{N-1}(\Gamma_n) = \infty, $$ which contradicts to the fact that $\Gamma$ has finite measure.  Is it my argument correct?


Prove that for positive integers $m, n$ and two positive numbers $p, q$ satisfying $p+q = 1$ we have $(1 − p^n)^m + (1 − q^m)^n \ge 1$.

Prove that for positive integers $m, n$ and two positive numbers $p, q$ satisfying $p+q = 1$ we have  $$(1 − p^n)^m + (1 − q^m)^n \ge  1.$$  Using binomial theorem, we have $1-C^m_1*p^n+C^m_2*p^2n-\cdots $ for $(1 − p^n)^m$. And same logic for the second term of the equation but they don't cancel each other out.  Is there anything I am doing wrong? (this is a practice from a probability class)


Proof for If $f : A \rightarrow B$ and $C \subseteq A$, then $f^{-1}(f(C)) \subseteq C$.

I was working on this with a group and the group came up with the following for a proof:  Suppose $c \in f^{-1}(f(C))$.  Then by definition of $f^{-1}$, $f(c) \in f(C)$.  Hence $c \in C$ and $f^{-1}(f(C)) \subseteq C$.  This doesn't seem correct as it doesn't assume the hypothesis.  i.e.  there is no assumption or use of $f : A \rightarrow B$ and $C \subseteq A$.  Is the proof the group came up with correct and if not any help on the proof would be nice.


I have constructed the number $7131372917538397234773191167617941438959$, which is prime as shown , using all primes under $100$ which contains two digits  by randomly ordering them as $31,37,29,\ldots, 59$  except $13$. I have got that number $7131372917538397234773191167617941438959$ satisfies the following properties:           1.- The sum of its digits is also prime: it is equal to $193$.          3.- The number is of the form $6n+1$          4.- This number can't be written as a sum of $3$ squares.      Now my question here is:          Could be this : $7131372917538397234773191167617941438959$ written as $x^{2}+y^{2}$ with $x, y$ integers?


How do I get jQuery to select elements with a . (period) in their ID?

Given the following classes and controller action method:  public School {   public Int32 ID { get; set; }   publig String Name { get; set; }   public Address Address { get; set; } }  public class Address {   public string Street1 { get; set; }   public string City { get; set; }   public String ZipCode { get; set; }   public String State { get; set; }   public String Country { get; set; } }  [Authorize(Roles = "SchoolEditor")] [AcceptVerbs(HttpVerbs.Post)] public SchoolResponse Edit(Int32 id, FormCollection form) {   School school = GetSchoolFromRepository(id);    UpdateModel(school, form);    return new SchoolResponse() { School = school }; }   And the following form:  <form method="post">   School: <%= Html.TextBox("Name") %>
   Street: <%= Html.TextBox("Address.Street") %>
   City:  <%= Html.TextBox("Address.City") %>
   Zip Code: <%= Html.TextBox("Address.ZipCode") %>
   Sate: <select id="Address.State"></select>
   Country: <select id="Address.Country"></select>
 </form>   I am able to update both the School instance and the Address member of the school.  This is quite nice!  Thank you ASP.NET MVC team!  However, how do I use jQuery to select the drop down list so that I can pre-fill it?  I realize that I could do this server side but there will be other dynamic elements on the page that affect the list.  The following is what I have so far, and it does not work as the selectors don't seem to match the IDs:  $(function() {   $.getJSON("/Location/GetCountryList", null, function(data) {     $("#Address.Country").fillSelect(data);   });   $("#Address.Country").change(function() {     $.getJSON("/Location/GetRegionsForCountry", { country: $(this).val() }, function(data) {       $("#Address.State").fillSelect(data);     });   }); });


I'm using OS X Yosemite - version 10.10.2. I have 1.12 TB fusion drive on my system. Recently I wanted to make a partition on my system, while making the partition on the system using disk utility some error occurred and partition was not created successfully.  The unusable partition of the disk.     The partition is not available here either.     So, here I'm not able to access the free space partition of my disk. The disk utility is not working with the free space partition. I want to resize the partition and want to have only single partition disk


what should be the range of $u$ satisfying following equation.

Let us consider that $u\in C^2(\Omega)\cap C^0(\Omega)$ and satisfying the following equation .  $\Delta u=u^3-u , x\in\Omega$ and   $u=0 $   in  $\partial \Omega$  $\Omega \subset \mathbb R^n$ and bounded .   I need hints to find out what possible value $u$ can take ?  Thank you for ur hints in advance .


I'm copying to LaTeX my notes on Maths subject. My professor is quite weird, and "invented" a Chapter 2 1/2 (two and a half) between chapter 2 and chapter 3. For example:   Chapter 2 Vector spaces and linear equation systems Chapter 2 1/2 Orthogonalization and least squares Chapter 3 Diagonalization   I want to keep the chapter numbering, labeling it as 2 1/2 and, if possible, keeping sections like "2 1/2.1", "2 1/2.2", etc. I know it's weird and I've searched a lot. The only thing I've found is typing   \chapter*{Chapter 2 \nicefrac{1}{2} \vspace{10pt} Orthogonalization and least squares}   But that doesn't appear in ToC and doesn't keep section numbering. How can I solve this? Any ideas are apreciated.  PS: sorry for my terrible English, I'm Spanish!  EDIT: I've tried two different ways from Paulo Cereda's answer (), whose MWE are:  \documentclass[11pt]{book} \usepackage[spanish]{babel} \usepackage[utf8]{inputenc} \usepackage{units} \newcommand{\strangechapter}[1]{\renewcommand{\thechapter}{#1}\chapter}  \begin{document} \tableofcontents \chapter{Cálculo diferencial en R} \chapter{Espacios vectoriales y sistemas de ecuaciones lineales}  \strangechapter{2 \nicefrac{1}{2}}{Ortogonalización y mínimos cuadrados} \section{Producto escalar} \setcounter{chapter}{2} \renewcommand{\thechapter}{\arabic{chapter}} \chapter{Matrices diagonalizables}  \end{document}   I've also used the same, but changing it a little bit:  \documentclass[11pt]{book} \usepackage[spanish]{babel} \usepackage[utf8]{inputenc} \usepackage{units} \newcommand{\strangechapter}[1]{\renewcommand{\thechapter}{#1}\chapter}  \begin{document} \tableofcontents \chapter{Cálculo diferencial en R} \chapter{Espacios vectoriales y sistemas de ecuaciones lineales} \clearpage% to flush out last chapter page with correct header and footer \renewcommand{\thechapter}{2 \nicefrac{1}{2}} \chapter{Ortogonalización y mínimos cuadrados} \section{Producto escalar}  \setcounter{chapter}{2} \renewcommand{\thechapter}{\arabic{chapter}} \chapter{Matrices diagonalizables} \end{document}   I've added \setcounter to keep the following chapters with correct numbering.  Both of them work great in the text, but the Table of Contents  doesn't show well, as the '1/2' is printed over the chapter of section name. How can I solve this?


I defended my PhD thesis over 5 years ago and obtained my PhD, but I was not happy with the thesis (a classic saying of many an academic, I know), but felt pressured to submit and move on to new things. Whilst I still like the thesis idea, what I wrote, the references, and the results, I now know I should have used a totally different mathematical theory to describe the proposed system/algorithm. Would a University allow someone to update a thesis after it has been "published" in the sense it's in the library and departmental library? Is there any point in asking the University or will this just be thrown out?


I have seen them grow up.    I have watched them grow up.      Though the intended meaning is conveyed in both sentences, I want to know which in this case is a better fit, see or watch.


How to execute a script just by double clicking like .EXE files in Windows?

How can I make a bash script executable by double clicking just like .exe files in Windows? I tried , but there are two consequences:   the terminal twinkles, disappears, and nothing is done. you must specify to run in terminal in order to work.   I have a script that installs tomcat on an offline PC, including all dependencies of tomcat in the script. I need to make the script work on double clicking like windows since most who use the script will not be familiar with Ubuntu.  Forget the above explanation. I want to make a script that can be run by double-clicking on it, without using the terminal. Anybody knows how?


Uninstall GRUB and use Windows bootloader

I have Windows 8 pre-installed, and then I installed GRUB with Ubuntu. Ubuntu is not my thing, so now I want to remove it along with GRUB. From what I have learned, with UEFI, GRUB does not overwrite the windows bootloader in the EFI partition and is stored elsewhere. How would I remove GRUB and make my PC use the Windows bootloader instead? It should be noted that I created a separate /boot partition when installing Ubuntu.


would you help me out with examining this sentence? "That might even could happen"  be considered incorrect? Thank you.


Is a good practice to copy an answer from a question to a new answer?

The OP was trying to put his answer in a question, but this was rejected as radical change. Should I copy this answer from the question and place it as a new answer?   Without copying this information it is simply rejected and lost.  Sample copied answer:


Let S be the set of stars in our galaxy. There is same number subsets as functions f : S --> {a,b}?

Question: Let $S$ be the set of stars in our galaxy. There is exactly the same number of subsets of stars in our galaxy as there are functions $f:S \to \{a,b\}$  .  My solution is; True.However, I'm confused with how to prove it. I know it can be proven by  using the formula of the number of elements in a subset and for the formula of the number of elements in a function and proving that both values are equal.   Can someone provide me with some feedback, please.


Copying Db permission between same instance

I have to copy the entire database permissions from database A to database B which has  same objects in database B in same instance.   What are the things that I need to copy from database A to database B to get the same permission as in database A.  Environment: SQL Server 2012 , in same server with same logins.


Removing the remembered login and password list in SQL Server Management Studio

I've recently used our company's spare laptop (that has a general user set up) while mine was being repaired. I've checked the "Remember password" option in SQL Server Management Studio when logging in to the database.   I need to clear the login and password information that I have used to prevent the next person that will use the laptop from using my login names and passwords. How can I do this?


What's the difference between OpenType vs. TrueType

I know very little about typography. What are the differences in terms of OpenType vs. TrueType? I do know that they are types of formats to render fonts (correct me if I'm wrong). Are there limitations between OpenType and TrueType?


Do moderators not have a way to just push a post into the close queue?

This is not a duplicate of  as that asks for the ability for moderators to cast a non-binding vote. This, on the other hand, asks for the ability to simply add things to community review, without casting a vote.  I like my hammer. It's nice to be able to instantly close an off-topic post, especially at times when the site isn't too active.  But the hammer is double-edged: if moderators constantly hammer-close off-topic questions, they never end up in the review queues, and the community gets "trained" to wait for a mod hammer.  If moderators could "mark" a post as (potentially) off-topic without actually hammer-closing it, the question would be taken to the close queue for the community to handle, and then the community gets "trained" to monitor the review queues.  The mechanism for such "marking" already exists: one would expect  an off-topic flag to get the question into the the close review queue for the community to handle. But as a moderator, flagging a post as off-topic has the same effect as a close vote: it's a binding action.  I think moderators should have both options: a binding close vote to hammer-close, and a non-binding flag to get a question community-reviewed in the close queue. This would be extremely useful, especially for gray-areas of a site's scope, where a binding close vote isn't an appropriate action.


Unable to input a correct location in careers

Tampere, Finland is a location. Tampere Theatre, Finland is a building.  I am unable to select Tampere, Finland as a location I am willing to relocate at. I do not want to live in Tampere Theatre. I'm scared of phantoms. ;)  I admit the building is at a certain location, but Tampere is not really that big place that it'd be necessary to split it up in smaller parts.  I wish I would at least be able to override it somehow.


Would you say 'Google is' or 'Google are'?

Would you use the third person singular or third person plural when referring to an organisation like Google?


Comparing $\pi^e$ and $e^\pi$ without calculating them

How can I  compare (without calculator or similar device) the values of $\pi^e$ and $e^\pi$ ?


How to compile a kernel identical to apt-get install linux-image-xxx

I download kernel source from git://kernel.ubuntu.com/.../ubuntu/ubuntu-trusty.git. I need to compile version 4.4.0-31-generic on 14.04.4 lts 64bit, so I clone and checkout branch Ubuntu-lts-4.4.0-31.50-xxx-14.04.1.I use config-4.4.0-31-generic as config file from linux-image-4.4.0-31-generic package. After I compiled, I realize kernel version is 4.4.13 in Makefile and I found arbitrary kernel version config item seems not take effect and installed modules is more than 5000 but package in linux-image-4.4.0-31-generic just contain about 1000 modules. The modules I installed size is around 3G, the package just 39M. Am I did it a wrong way?


Converting mxd to earlier version using ArcPy?

I am running arcmap 10.2.2 but need to open an mxd saved using 10.3. I do not have access to 10.3. I have an arcpy tool which will do the conversion but it is not working from within 10.2.2.   Does anyone know if it is possible to do this from within 10.2.2. I get an error message saying I do not have write access to the file.  The script is as follows:   import arcpy, sys, os, string   mxdList = string.split(arcpy.GetParameterAsText(0), ";")  outloc = arcpy.GetParameterAsText(1) version = arcpy.GetParameterAsText(2)  suffix = "_"+ version.replace(".", "")  for item in mxdList:      item = item.strip('\'')      mxd = arcpy.mapping.MapDocument(item)      base = os.path.basename(item)      base = os.path.splitext(base)[0] + suffix + os.path.splitext(base)[1]      mxd.saveACopy(outloc + os.sep + base, version)     arcpy.AddMessage(os.path.basename(item) + " has been converted")


PHP MYSQL Storing Passwords for recall by PHP

I know full well its not safe to store logins in plaintext however I've been unable to find an answer to my specific question. What I'm trying to do is store server passwords in a database for recall with an automated php script however I'm paranoid about the db being hacked so I need to insure they are not retrievable in the event it does get hacked. As with any project I'm planning for a "worst case" situation. The passwords themselves are generated randomly.


Click event not getting generated for button generated through dynamic rows

I am building a Django web app with backend. I load the html page dynamically from database and I populate a dynamic table like this, with the delete button in each row predefined and I need to pass a particular cell value to the click event for deletion so i set it to the button id and pass it through a onclick event, but the event is not getting generated and no alert is produced. I am seeing a lot of examples but i have tried all and even style i added only because of that, i prefer to do it with the <input type="submit" value="Submit"/> button if possible, but in any case the event is not getting generated. The code is below: Can anyone please help? <form name="Dashboard" method="GET" id="AccountForm" action="create">


How can I use my Xbox One S controller via bluetooth?

I got an Xbox One S controller as a gift for Christmas and I found out that it can connect to a PC with Bluetooth. It's supposed to work on Windows 10 but it doesn't work on my Ubuntu PC. It shows up as an option in the Bluetooth settings but when I connect to it it just instantly loses connection. How can I use the controller via Bluetooth on my Ubuntu 17.10 PC? I would like to use it for emulators and maybe even Steam games.


How can I paste commands on Minecraft Command Blocks?

So I have a mac computer but i plugged in a windows keyboard in my mac. I am still trying to figure out how to paste commands into a command block. So how can I paste a command?


Why my CAPS status resets every time i change language

Edit: I did a new question as this is hapening for years!  I will post a new question every year about this.  Hi there and greetings from Kefalonia/Greece.  I have a little issue: Every time i change the keyboard's language using alt+shift, my CAPS status resets and i have to press again the CAPSLOCK key to write in capital letters.   Any Ideas on how do i get it to stop reseting?


How can I access to "shared with me" folders?

Obviously, shared with me folders are visible on the Google Drive web, but I cannot find them on my local Google File Stream. One suggestion online was to create a shortcut on my own Google Drive, but it didn't work. Any idea?


Im trying to insert data into my database, it works when i dont use the $_POST['wagee'], but I cant get it to work pulling data from my form. Any help is greatly appreciated. Thank you!  here is the error I get:  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' '2')'  at line 2   This is my code:  <?php   $message = "";   if(isset($_POST['addhoursbutton'])) {    addwage(); }   function addwage() { include 'components/sql/config.php';  $sqlupdateincome = "INSERT INTO income (username, projectname, hourlywage, totalhours) VALUES ('John', 'Ochrom Test', ". $_POST['wagee'] .", '2')";  if ($conn->query($sqlupdateincome) === TRUE) {     echo "New record created successfully"; } else {      echo  "Error: " . $sql . "<br>" . $conn->error; }  $conn->close(); } ?>


Let $a_{n+1}=\sqrt{a_1+a_2+\cdots+a_n}$ .Prove that $ \lim\limits_{n \rightarrow \infty} \frac{a_n}{n}=\frac{1}{2}$

A sequence $a_n$ is defined as $a_1=1$ and $a_{n+1}=\sqrt{a_1+a_2+\cdots+a_n}$ .Prove that $ \lim\limits_{n \rightarrow \infty} \frac{a_n}{n}=\frac{1}{2}$  I have no idea how to approach this. But I have a feeling that Cesaro's lemma may come in handy


How can I make chrome always display the address bar? It autohides when I scroll and then I need to scroll back to show it

How can I make Chrome on Android always display the address bar? It autohides when I scroll and then I need to scroll back to show it.  Please. I have googled it for quite some time already.


I have used LaTeX on and off for a number of years now for several large documents with evolving versions over long lifetimes. But every time it seems like, powerful and wonderful as LaTeX is, there arise cases where I want to tweak the pagination in ways that are impossible without using the \newpage or \clearpage sledgehammer.  The macro I think I want is something like  \ifnotremaining{<length>}{<cmd>}   that is, if less than  space remains on the page then perform . For example:  \ifnotremaining{5cm}{\newpage}   Note that <length> need not be perfect–if a little too big no problem, or a little small (perhaps because the "protected" text got bigger) then you just increase it a bit. FWIW, I am usually happy with \raggedbottom.  An alternative might be a \disablepagebreak and \enablepagebreak pair which could be used to forbid a page break in the given range of text. (This capability cannot be formulated as an environment because it cannot always nest wrt other environemnts.)  Is there something I have overlooked that can fill this need?


I have two variables. One variable gets set to the other, but I would like to assign the value, not the pointer. , a variable, when assigned, is set to the same pointer of the source variable.  Here is a boiled-down version of my code:  var foo = { "baz": "qux" }; var bar = foo; foo.baz = "quuz"; console.log(foo); // should equal {"baz": "quuz"} console.log(bar); // should equal {"baz": "qux"}   Is there an easy, straightforward way to do this? If so, I can't find any documentation of it.


Updated stuff with Updatemanager problem

I thought I needed to update stuff because of my computer randomly logging me out, So I saw that there was 1,418 updates so I installed them then after that I restarted the computer and I logged in and all that I saw was only my background picture of my desktop... Nothing else just the picture.


Use "Add 3D Function Surface" addon via python

I would like to know if there is any way to use the "Add 3d Function Surface" addon via the python interface.  I have an equation that describes a surface in the three-dimensional space that I can use to make a mesh object as described in . What I would like to know is if there is any way to do such a thing via the python interface.   As an example, I would like to be able to do something like:  def mysurface(u, v):    return numpy.array([u*v, u-v, math.pow(u, 2)])  add_mesh_from_surface_equation(func = mysurface, urange = [0, 10], vrange = [0, 10], ustep = 0.01, vstep = 0.01)   Is it possible to do something like this?


fixed point of a continuous map on a projective space

Let $f:S^{2n} \rightarrow S^{2n}$ be a continuous map. Show that          there exists $x \in S^{2n}$, such that $f(x) =x$ or $f(x) = -x$;   any continous map $g: \mathbb R P^{2n} \rightarrow \mathbb RP^{2n}$ has a fixed point;      I think 1 implies 2. So, how can I find an $x$ in 1?  Thanks for the help.


What package must I load to be able to write \mathbb{Z}?

Downloaded TeXworks a couple weeks ago and have been using it to type my mathematics homework in LaTeX. I keep having to write sentences such as: Let $n$ be an integer. There are times when I would much prefer to write similar statements in symbols. For example: Let $n \in \mathbb{Z}$. But every time I click to compile I get a message saying \mathbb{Z} is not recognized. I am assuming this is because I am not loading the proper package.  I am writing \usepackage{amsmath} before I begin the document. Should I be loading a different or additional package to be able to use these additional symbols, such as the symbol for the integers? If so, what package?


In Terraria, how do you kill the twins if your Vampire Knives or Legendary Terra Blade won't destroy them?

So I got some overpowered weapons from a friend and decided to start destroying bosses...killing Skeletron, the eye of cthulu and his brains, plus the eater or worlds and skeleton prime, and the wall of flesh...but then I hit a roadblock. I need help killing the twins...any advice?  Note: if it is important, I have hallowed armor, every NPC housed and I play Xbox 1/console


Raw images usage and technical explanation?

How to take RAW images in Canon 600D ? What is the use of making RAW than jpg ? Does the quality differs or the we can edit easily ?


Why do SD cards and USB drives have less space than advertised? This is even after accounting for unit prefixes defined in powers of 1024.  For instance I have an SD card from SanDisk that was advertised to contain 8 gigabytes of storage. The total number of 512-byte sectors available for use is 15523840, which is equal to 7948206080 bytes. Now, that's close to enough to 8000000000 to get there by rounding to the nearest gigabyte, but it is still 51793920 bytes less than that value.  Is the missing 51793920 bytes of space there but not exposed by the card's microcontroller or is it just not there at all?


How long could a meat-based broth be held safely near 180F/82C?

This question is the flip-side of the commonly asked food temperature safety concerns. I'd like to know, if a meat-based soup stock (chicken/pork/beef/etc) were to be held constantly at a safe hot temperature of 165F/73C-180F/82C, how long could it stay at this temperature and still be considered safe to eat?  Obviously, it would reduce over time, but suppose it's reconstituted with water regularly so that it could continue being held... Is there ANY sort of time limit (even completely unreasonable spans like, months, years, etc)?


How to open IE11 print preview from button click ng2

I want to call print preview from button click in angular 2. I need to support IE11 users. Chrome automatically open print preview on print but IE11 opens only print window.    In template:  <button (click)="print()">print</button>   In ts file:  print(){   print() //lib.es6.d.ts }   How can i open print preview in IE11?


I have many unnumbered sections in my report (more than 100), all created with:  \section*{section name}  I want to find a way to easily add them all to the TOC (specifically to a minitoc). Since I use the * to remove the numbering, they won't appear in TOC. I found out in minitoc documentation that I should use:  \addcontentsline{toc}{section}{repeat here section title}   However, I don't want to have a duplicated title in every section, or even to change all the involved files to add those already written sections to the TOC. How to add those sections' names to the minitoc without using the addcontentsline command? Is it possible?


Clicking the "flag" action link on a notified-as-edited question results in wrong internal page state

When trying to flag a post (question, in this case; I haven't tried with answers, but I suspect that it works much the same so may have the same problem) which is being edited, it seems like the page internal state can end up being inconsistent, leading to an incorrect error message displayed to the user.  Steps to reproduce:   Open the page for a question, any question, any question at all. Open the same question in an additional tab, or coordinate with an additional user to do so. In the second tab, make an edit to the question. In the first tab, note that the "an edit has been made" bar appears at the top. Do not dismiss this. In the first tab, click the "flag" action link below the question text. Expected result: Flag dialog should open. Observed behavior: The question text is refreshed with the edit, but the flag dialog does not open. In the first tab, immediately click the "flag" action link again. Observed behavior: An error message appears that you can only open the flag dialog once every three seconds.   The workaround is easy: just wait those few seconds and try again.  I'm suggesting that instead of as observed in step 5 above, the text should be refreshed and a message should be displayed to the user encouraging them to reconsider the flag in light of the edit now visible, but that this does not count as actually opening the flag dialog.


For some numbers $n!+1$ is prime, but all such numbers are not prime. For example, $5!+1 = 11\times 11$. The question is this:  Are there infinitely many primes of the form $n!+1$?


Why function in if condition is not hoisted in JavaScript?

How can a variable declared in if condition is hoisted and not function? Example 1:  var x = 1; if(a = 1) {     x += typeof a; } x;    // 1number a;    // 1   When tried same with function in SpiderMonkey and V8 hoisting didn't happen. Why not? What happens to function in if condition? Example 2:  var x = 1; if ( function f () { return 9; } ) {     x += typeof f; } x;     // 1undefined f;     // ReferenceError: f is not defined   However when function is defined inside if on success function is hoisted Example 3:  var x = 1; if ( true ) {     x += typeof f;     function f() { return 1; } } x;    // 1function f;    // f() typeof f;   // function   Even if condition is false function is hoisted Example 4:  var x = 1; if ( false ) {     x += typeof f;     function f() { return 1; } } x;    // 1 f;    // undefined      not ReferenceError: f is not defined // f still got hoisted   What's happing at example 2? Why function is not hoisted when variable did in example 1?


How do I extrude faces from vertices as "center line"?

The blue annotation is my goal. See here:


iPad Other Storage - what is it and how to clear it up?

iTunes reports my iPad has 4Gb of "other" storage (yellow). It was 6Gb before I did a sync.  What is this and what can I do about it?


Easy way to compute logarithms without a calculator?

I  would need to be able to compute logarithms without using a calculator, just on paper. The result should be a fraction so it is the most accurate. For example I have seen this in math class calculated by one of my class mates without the help of a calculator.     $$\log_8128 = \frac 73$$  How do you do this?


How do I automatically create content after checking out a product?

Is there a way or any module out there that would enable me to automatically create content after checking out a certain product?


Can you help me understand why this happens: $ echo [023456789] [023456789]  $ echo [0123456789] 1  With your feedback, I'm hoping I can figure out how to write a bash script that can take an argument with the value of [0123456789] and assign that literal string to a variable.


Can I disable inbox alerts for new trading cards?

I like how my inbox icon lights up in green when I have new messages or new games from friends; but I'm not interested in trading cards, and it annoys me when after each gaming session I get a bunch and the inbox lights up.  Is there a way I can prevent the inbox alert from appearing for new trading cards?


How can a processor execute more IPS than its frequency?

This has been something that I can't seem to wrap my head around. Just about every modern processor is able to execute more instructions per second than its frequency.  I can understand why lower class processors can execute fewer IPS than its frequency. For instance, the  executes about 16 MIPS at 16 MHZ (or at least that's what I've been told), and the  executes 0.5 MIPS at 4 MHz. But then the Pentium 4 Extreme can execute more than 9 GIPS at only 3.2 GHz. That is about three instructions per clock cycle!  How is this done, and why isn't this implemented in smaller processors, such as  microcontrollers?  I found all of my information, except for the ATmega328, from .


Early today, I logged in to SE, and the top bar (trophy cup icon) showed a rep change of +27. When I pulled it down to see the details, it showed +20 in each of two stacks (three actions - two different answers upvoted in one stack, one answer upvoted twice in a second stack). I went through all of my stacks, and found that the difference (-13) between +40 and +27 was accounted for by a removed question in a third stack.  Can the 'trophy cup' be fixed so that rep decreases are also reported?


TikZ rectangular node with different rounded corners

This is my minimal example:  \documentclass{article}  \usepackage{tikz}  \begin{document}     \begin{tikzpicture}            \node[rounded corners=3pt, draw, fill=red!20]{Hallo!};    \end{tikzpicture} \end{document}   I'd like to define different values for rounded corners (i.e. 5pt for north-west and north-east and 2pt for south-east and south-west).


Need Help Understanding Arrays in Methods - java

I'm a beginner at programming with little to no experience. I want to learn Java because I feel like it's such a great language to learn from. I've been following the guides on this playlist on youtube  If you look into it, I'm on the 32nd video and so far Java is very promising Anyways, I need help understanding this code: package learningjava;  class apples{ public static void main(String args[]){     int lucas[]={3,4,5,6,7};     change(lucas);          for(int y: lucas)         System.out.println(y); }  public static void change(int x[]){     for(int counter=0;counter<x.length;counter++){         x[counter]+=5;       }    } }  This code is supposed to take the array: int lucas[]={3,4,5,6,7}; and add 5 to each number inside of the array. Then, it's supposed to display the sum of these numbers with 5 added to them; which it does just that, displays 8, 9 ,10,11,12. I just hope that someone could clear up the smoke for me on this one, cause it's hard to follow. I don't understand how array lucas is connected to int x[]. I also don't understand why we need the for loop or what it does.: for(int counter=0;counter<x.length;counter++){     x[counter]+=5; }  This post was poorly made and explained, but I'm desperate at this point to know what exactly is going on in this code. If anyone could give me a thorough explanation, I would REALLY appreciate that!


Before the 2.8 I hid some meshes and now i cannot unhide them... Here is an image.


Is there any "official" guidance to upgrading from Lubuntu 18.04 LTS (LXDE) to Lubuntu 18.10 (LXQt)

Since there are major differences between Lubuntu 18.04 LTS and Lubuntu 18.10 primarily involving the change from LXDE to LXQt is there any guidance available for those who wish to upgrade from 18.04 LTS to 18.10, as opposed to performing a clean installtion of 18.10?


Prevent windows 7 or 8 from opening windows on top

When I launch a program on windows it usually opens on top. It does not care if you are currently working on the other screen. It will take off the focus on the window you are working on and give focus to the new program that just launched.   Apple computers do not have this problem. If you launch a program it will load in the background and it will be minimized. For example I often compile my code in visual studio and that usually takes about 30 seconds. I tend to work on other stuff meanwhile its compiling. If I am typing an email for example then all of a sudden I will not be able to type any more and the program will launch on top. It will be nice if the newly launch program opened minimized flashing in the taskbar.


difference between string and @string for directory

Sometimes I find that many people use @string for locate a directory than use string even I though that they are same. for example :  I have variable that called direct  string direct = "C:\\Users";   And then,I type :   System.IO.Directory.CreateDirectory(@direct);   I think it's same with  System.IO.Directory.CreateDirectory(direct);   But,what's difference between @direct and direct?


I am looking to build a camera trap for wildlife viewing, able to capture pictures (or even videos) in decent quality to be able to identify distinct features. I do however need to be able to see the pictures in real time, so the camera would need some sort of wireless connection to a receiving device such as a phone.  I thought of using an FPV setup as used in drone racing, but the quality and range seems to be quite low, and the strengths of an analog signal seem to be latency and fps, which are both not important to me. It would be nice to have some sort of digital signal to be able to do some editing, such as storing pictures. It would also be cool to connect several cameras to one device.  Are there any solutions to this problem? Would a raspberry pi/arduino setup work in some way? Thanks!


JavaScript - Why is 55.91 - 35 inadequate?

If I do console.log(66.91 - 15);  I get the desired result of 51.91 But if I do console.log(66.91 - 35);  I get 31.909999999997 Why is that? I there an easy way to prevent that? Thanks in advance.


Geometric Hahn Banach implies Analytic Hahn Banach.

I want to prove that the geometric Hahn Banach theorem implies the analytic one.   Edit:  To avoid confusion I will state the vesion of H.B theorems im familiar with:  Analytic H.B:   Let $X$ be a linear space(over $\Bbb R$) and $Y\subset X$ a subspace. Let $p:X \to \Bbb R$ be a sub-additive function. Suppose $f:Y\to \Bbb R$ is a linear map s.t $f(y) \le p(y)$ for all $y\in Y$ then there exists an extention $g:X\to \Bbb R$ of $f$ s.t. $g(x)\le p(x) $ for all $x\in X$.  Geometric H.B:  Let $X$ be a linear space. $K \subset X$ convex s.t. each point in $K$ is an internal point. Let $D$ be a plane disjoint from $K$ then there exists hyperplane that contains $D$ and disjoint from $K$.  In my problem $X$ is NOT a normed space so there are no open sets.   Given $X$ a linear space and $Y\subset X$ a subspace $p:X\to \Bbb R$ sub-additive, and $f:Y\to \Bbb R$ linear s.t $f(y)\le p(y)$ for $y\in Y$ we need to extend $f$ to $g:X\to \Bbb R $ and $g(x)\le p(x)$ fo r all $x\in X$  So, we look at $X \times \Bbb R $and define $K = \{(x,t) : t>p(x)\}$.  The fact that $K$ is convex is easy. How can I show directly that every point in $K$ is internal? (can't say that $K$ is open).  Now after showing that, we can look at $Graph(f)$ and observe that $Graph(f)\cap K = \emptyset$.  So by the geometric H.B theorem we have a hyperplane (which is a maximal subspace in this case because $(0,0)\in Graph(f)$ ) M containing $Graph(f) $ and disjoint from $K$.  Now my problem is to show that each $x\in X$ has a unique $t\in \Bbb R$ s.t. $(x,t) \in M$.  (I need it in order to extend $f$).  I know that if we take $v_0\notin M$ then each $v \in X \times \Bbb R$ has a unique representation as $v = \alpha v_0 + m$ for $m \in M$ , this is because $M$ is a maximal subspace. not sure if that helps.  Thanks for helping!


Where is the "Manipulate Centers Only" button in Blender 2.8?

I have looked just about everywhere on the Internet and I can't find the answer to this question. Where the hell is the "Manipulate Centers Only" button in Blender 2.8???? It's the the double arrow icon here:    I seem to have enabled it somehow and I can't scale or rotate my object.


OK in Skyrim I had a follower but then they disappeared. I've seen another question a lot like this but the answers to it did not help. I was wondering what quest would teleport me because one of the answers to that other question said that if I got a quest that teleported me automatically  then my Follower would appear next to me.  It was Mjoll the lioness. I went back to where I originally got her (at the Bee and Barb)  and she was there but it says that i already  have a follower but I don't.  I was able to pickpocket my items from her but I still can't have a follower now.  So to summarize what is a quest or quest chain that will teleport me so I can get my follower back?