Objective is to come out of 'final result while loop' (added as comment) once p1 or p2 wins. I have created a global flag which is initially False but once the winningfunc() returns result1 or result 2 equals to 3, flag is turned to True. I understand there might be verbose, but I am new to python or coding of any sort.   Trying to make a simple tic tac toe. Any help is appreciated :)  frame=[[" ","|"," ","|"," "],       ["-","-","-","-","-"],       [" ","|"," ","|"," "],       ["-","-","-","-","-"],       [" ","|"," ","|"," "]]  # Name assignment while True:     p1_name=input("Enter player 1 name: ")     p2_name=input("Enter player 2 name: ")      if p1_name.lower()==p2_name.lower():         print("Both names entered are same, please re-enter!")     else:         break # Notation assignment  while True:     p1_nt=input(f"{p1_name}, choose 'X' or 'O' to play with: ")     if p1_nt.lower()=="x":         p1_nt="X"         p2_nt="O"         print(f"{p1_name} will play with 'X' & {p2_name} will play with 'O'")         break     elif p1_nt.lower()=="o":         p1_nt="O"         p2_nt="X"         print(f"{p1_name} will play with 'O' & {p2_name} will play with 'X'")         break     else:         print("Entered notation is wrong, please re-enter!")  # dict  dc={"1":[4,0],"2":[4,2],"3":[4,4],"4":[2,0],"5":[2,2],"6":[2,4],"7":[0,0],"8":[0,2],"9":[0,4]}  # winning logic definition flag=False def winningfunc ():      def mf(v1,v2,v3):         result1=0         result2=0         for x in range(v1,v2,v3):             if frame[dc[str(x)][0]][dc[str(x)][1]]==p1_nt:                 result1+=1             elif frame[dc[str(x)][0]][dc[str(x)][1]]==p2_nt:                 result2+=1             else:                 pass         if result1==3:             flag=True             print(f"Congratulations, {p1_name} wins! ")                     elif result2==3:             flag=True             print(f"Congratulations, {p2_name} wins! ")                     else:             pass      mf(1,4,1) # for c4     mf(4,7,1) # for c2     mf(7,10,1) # for c0     mf(1,10,4) # for d1     mf(3,8,2) # for d2     mf(1,8,3) # for r0     mf(2,9,3) # for r2     mf(3,10,3) # for r3  # loop for payer input  while not flag: # for final result      while True: # for p1 data filling          s1=input(f"{p1_name} its your turn: ")         if 0<=int(s1)<=9 and frame[dc[str(s1)][0]][dc[str(s1)][1]]==" ":             if p1_nt=="X":                 frame[dc[str(s1)][0]][dc[str(s1)][1]]="X"             else:                 frame[dc[str(s1)][0]][dc[str(s1)][1]]="O"             break         else:             print(f"Wrong entry {p1_name}, try once again!")     x1=None             for x1 in range(len(frame)):         f1="".join(frame[x1])         print(f1)     # Result check for p1     winningfunc()           while True: # for p2 data filling          s2=input(f"{p2_name} its your turn: ")         if 0<=int(s1)<=9 and frame[dc[str(s2)][0]][dc[str(s2)][1]]==" ":             if p2_nt=="X":                 frame[dc[str(s2)][0]][dc[str(s2)][1]]="X"             else:                 frame[dc[str(s2)][0]][dc[str(s2)][1]]="O"             break         else:             print(f"Wrong entry {p2_name}, try once again!")      x2=None     for x2 in range(5):         f2="".join(frame[x2])         print(f2)     # Result check for p2         winningfunc()


'in order to meet her' VS. 'to meet her' any difference could be?

I went there in order to meet her VS. I went there to meet her.  Could be any difference? I think my question should be more specific. 'in' is a preposition and 'order' is a noun. I know 'in' but 'order' has many meanings. What does the 'order' here mean as a noun? I see some people explain on this site 'in the intention to to do something', then the 'order's meaning is 'intention' but I couldn't find the meaning in any ordinary dictionaries.


How to remove the "\n" from the end of my string

I had a list that read from a text file into an array but now they all have "\n" on the end. Obviously you dont see it when you print it because it just takes a new line. I want to remove it because it is causing me some hassle.  database = open("database.txt", "r") databaselist = database.readlines()   thats the code i used to read from the file. I am a total noob so please dont use crazy technical talk otherwise it will go straight over my head


Why do Methods marked @TestSetup in Classes marked @IsTest count against test coverage requirements?

Every test class on my org that has a TestSetup annotated method shows 0/n lines covered in the developer console (Where n is the number of lines in the annotated method).  I thought maybe this was just something it showed and didn't count against test coverage. But then I pulled out a calculator and added up all the lines showed/covered and got what the org is telling me my coverage was.  So I then took out the TestSetup lines from the total and divided again. I gained a few percentage points for org wide code coverage.  I feel like this is something obvious that shouldn't count against an orgs code coverage. So I am here checking to see if I am missing something.  I did find this earlier , but I think the question was mis-understood.


Conditional sentence without conditional conjunctions, is that possible?

Sometimes I hear sentences that sound conditional to me, just because of the (unassertive) ordering of the words. I don't know if I can come up with a proper example. Consider this:          I'd be a lot better, had she stayed with me.        And I guess it's equivalent to this conditional form: If she had stayed with me, I would have been a lot better.  So, this is my question: In what ways can you make a sentence conditional without using conditional conjunctions (if, unless, etc)? And what are their equivalent conditional forms?


Link "Show more comments" does not disappear on mobile devices

I noticed that the same bug marked as fixed (status-complete)  still exists when using a mobile device:  When I'm not logged-in, and click the "Show N more comments" link, then:   the hidden coments are show the "Show N more comments" link stays visible when I click the link again, I get a small yellow popup with the message "Commenting requires an account with 50 reputation"   I reproduced this bug on an android 4.3 device with both the latest Chrome and the standard android browser.


How to open a list of URLs in Firefox or SeaMonkey?

I have a list of URLs in a text file, for example,  http://url1 http://url2 http://url3   I wonder how to open them each in one tab in Firefox (or SeaMonkey), without the hassle of creating a new tab, copying into address bar and hitting return for  each URL?  My OS is Ubuntu 10.10. Both command line and GUI solutions are welcome.


Merge split terminal tab back into one terminal

In a terminal window, I can use File > Open Tab to get two tabs in the same window. Then, if I move the terminal up to the top of the OS, those two tabs become two separated windows.  How can I merge those two windows back to one (like I had before)?


I was at an English lesson and I said “a live organism”, but the teacher immediately interrupted and said “you should have said “a living organism”” “I didn’t catch that” said I. and a classmate of mine said as the teacher had done. Then I told them that “ a live something and a living something are both correct because they are both adjectives” What is the difference between these ones? I know that there has already been another question, but an answer has not been chosen, I have  also seen some answers which are different from the ones in this website.


How do you make a jagged circle edge smooth?

I would like to make the edge of this mesh a smooth circle. Any suggestions?


I'm relearning mathematics by reading through . It begins by explaining the natural numbers, introducing the following property:  $a.0=0$  To make $a$ the subject, I would divide both sides by zero, leaving:  $a=\frac{0}{0}$  I'm aware, but unsure why, that division by zero isn't allowed. I also look at that equation and read it to mean that any natural number $a$ is given by $\frac{0}{0}$, which can't be right. Moreover, cutting a non-existant cake into no pieces makes my head spin.  Is it correct to say that the mistake is the division by zero, or is there more to this than meets the eye?


Below is my mysql table. CREATE TABLE `mydb`.`mytable` ( `id` INT NOT NULL AUTO_INCREMENT, `comment` VARCHAR(100) NOT NULL , PRIMARY KEY (`id`)) ENGINE = MyISAM;  ALTER DATABASE mydb CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;  ALTER TABLE mytable CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;  Below is my php code. <?php     if(isset($_POST["submit"])){         $con = mysqli_connect("localhost","root","","mydb");         $comment = mysqli_real_escape_string($con, $_POST['comment']);         $sql="INSERT INTO `user`(`comment`) VALUES ('".$comment."')";         if (mysqli_query($con, $sql)) {             echo "New record created successfully";           } else {             echo "Error: " . $sql . "
" . mysqli_error($con);           }     } ?>                    <form method="POST">             <input type="text" name="comment">             <input type="submit" value="submit" name="submit">         </form>        when I try to submit with emojies in localhost, unknown characters were stored (inserted) in localhost. when I try to submit with emojies in 000webhost.com, no records were inserted to the database. But I can store emojies directly in both database(localhost & 000webhost.com) by executing following sql command directly in mysql server(PHP MYADMIN). INSERT INTO `mytable`(`comment`) VALUES ('😜');  But I couldn't insert emojies using PHP. So my question is how to insert emojies using PHP to mysql server?


Is there a limit as to how fast a black hole can grow?

According to the article above, we observe this supermassive black hole as it was 900 million years after the formation of the universe, and scientists find its extreme specifications mysterious because of the relatively young age of the Universe at that time.   Why would the 12 billion Solar Masses mass value be mysterious, unless there was a limit of sorts to the rate of mass consumption by a black hole? (naive point: Why would 900 million years not suffice for this much accumulation, keeping in mind that most supermassive stars which form black holes have life-spans of a few tens of millions of years at most?)


How to check that a user/password is expired in AIX?

I can check that the user is expired or not with:   lsuser -f USERNAME | fgrep expires   But how can I check that the user's password is expired or not? Are there any other "expiring" things that can cause trouble? [so that user can't login, because he can only reach a server through FTP and his password expired, and he can't change it, because he hasn't got SSH access to give out the "passwd" command to update his password.]


The rustling grass is driving me crazy - does it actually mean something? I've tried walking towards it, I mean I have actually walked in circles for five minutes in a Home Depot parking lot and in my neighborhood, but nothing ever comes of it.  I've tried tapping the screen where the grass is rustling - nothing.  Sometimes I see little pieces of green, other times it is substantially bigger. But never a pay off.  What am I missing?


Difference between "you can't do nothing" and "you can't do anything"

I have heard people say for example:     You can't do nothing to me   is it the same thing as     you can't do anything to me   If no, what's the difference?  I personally think the latter is correct. Would love to hear you guys thought on this.


How to create a visual scale for resume?

In LaTeX, I am trying to scale my skills visually for my resume. So it should be something like this:    Is there an easy way to do it?


Was Luke aware the Emperor was a Sith Lord?

Similar to , I'm asking the more specific question, was Luke aware that the Emperor was a Sith Lord? I don't recall it being mentioned in any of the films.  If yes, at what point does he learn this? If not why did Yoda or Obi-Wan not warn him?  Perhaps he could have avoided being defenseless and struck by Force Lightning if he'd been made aware?


Do I include the possessive apostrophe in the parentheses after defining an acronym

If I use a possessive apostrophe and then denote a term as an acronym i.e. "the US Government's (USG's)," I don't include the apostrophe after "USG," right? It just feels a bit odd when I don't, as if a term is plural one generally includes the 2nd "s" if denoting an acronym (i.e. Project Managers (PMs).


Is Windows Home and Windows Home Single Language is same edition?

I have a product key for windows 8.1 (Single language edition or not that i can't remember). I have currently windows 10 pro installed.  I am planning to install windows 10 Home so i activate with windows 8.1 key.  So my question is will i be able to activate it if the Product Key is Windows 8.1 Single Language and i install Windows 10 Home(Multiple language edition) or vice versa.


I'm working through understanding Clay Institute's paper addressing their Navier-Stokes millennium prize. I can't find any resources online stating if there are any infinitely differentiable examples in nature. I looked up vortexes and found the curl is constant inside the vortex, but discontinuous outside of it, which would, I think, deny the vortex to be able to solve the problem for an incompressible fluid. This is also the case with EM fields which are "almost" completely differentiable. However, is gravity infinitely differentiable? Newton's or GR? Is even the law of motion infinitely differentiable? I haven't found any hits on duckduckgo. Thanks in advance to any help.


Show the series an/(1-an) converges given that series an converges

Given that $0\le a_n\lt 1$ the series $\sum_{n=0}^{\infty} (a_n)$ converges. Show that the series $\sum_{n=0}^{\infty} \frac{a_n}{1-a_n}$ converges.  This question is supposed to be solved from first principles (e.g. Comparison Test); however, any approach would be appreciated.  I noted that $\frac{a_n}{1-a_n} = a_n + a_n^2 + a_n^3 + ...$ but I can't seem to finish the proof rigorously.


Electromagnetic radiation of charges under accelerations

If we shake a electron back and forth I understand how it radiates electromagnetic wave. But I do not understand how a charge going in circular path or accelerating in a straight line radiates. Please answer it and do not mark it as duplicate. Does only electron in simple harmonic motion radiate?


The following code is from Bates and Sierra:  public class Book {     private String title; // instance reference variable      public String getTitle() {        return title;     }      public static void main(String [] args) {        Book b = new Book();        String s = b.getTitle(); // Compiles and runs        String t = s.toLowerCase(); // Runtime Exception!     } }   Why does String t = s.toLowerCase() cause a runtime exception when String s = b.getTitle() does not?


Is every dense subspace of a separable space separable?

If $X$ is a separable topological space, and $V$ is some dense subspace of it, is $V$ necessarily separable?


Is there a way of getting the exact index of an element in a for-loop in Python?

I was wondering if there's a better way of getting the index of a substring than this method: s = 'alphabet' for i in s:     print(s.index(i))  The problem of the s.index(i) function is that it's returning the first appearance of i, meaning that the second 'a' would return the index 0 (but it's actually 4).


Why quasistatic doesn't imply reversible process?

Quasistatic process are almost always in equilibrium. We know that equilibrium implies zero entropy change. And zero entropy change implies that the process is reversible. So why quasistatic doesn't imply reversible?


If $a, b$ are positive integers such that $a|b^2, b^2|a^3,....$ then $a=b$.

The following is a well known problem   If $a|b^2; b^2|a^3; a^3|b^4; ....$ then $a=b$.  I started with $a$ is a prime $p$ and the conclusion immediately holds.  So I was comparing powers of primes but can't get anything useful.  Please help.


According to the "list verse" time gets to a pause when someone or something travels at the speed of light. But a question still lies in my mind, if time always travels forward and does not stop at any point then how come it gets to a pause with respect to a body travelling at speed of light?


Why does my SSH private key still work after changing some bytes in the file?

I (for a test) just randomly altered a private RSA key by opening it up in Vim and changing a few bytes. It is the private part of an SSH key pair used for logging in on a remote system. Puzzlingly, it still allows me to login.  I did some research and found that it is a base64 encoded ASN.1 container, so I pulled all the relevant integers out with OpenSSL and it seems only $d$, the private exponent, has changed (and only slightly at that). Is it possible the additional cached values are therefore being used to decrypt the value sent from the server, in order to still allow me to be logging in? The public key can (as expected) still be derived due to the other integers in the ASN.1 still being the same.  As I'm an encryption dufus I'd appreciate some guidance on how the above is possible. I've found when I modify the key in Vim by larger amounts it rejects me as expected. Thanks.


How to make the simple three square box and connect them?

I want to make the three square box and simply connect them.


I have a second monitor which was getting a low resolution at start up. Using xandr I am able to add the proper resolution (1360x768). How do I make it permanent? I saw another post about this, but it wasn't exactly the same.  Thanks for any info.


why does my tablet say insufficient space?

I have a few apps, but this tablet is new and I want more apps. Every time I say download, it says I have insufficient space. Please help!


Difference between max and min uniformly distributed values

Let $X_1, X_2, X_3, X_4$ be independent and all uniformly distributed on $[0,1]$. Find the PDF of $Z$, the difference between the largest and smallest values, $X(\max)$ and $X(\min)$, respectively. Hint: Find the joint PDF of $X(\max)$ and $X(\min)$ first. Then compute PDF of $Z$.


Can work with RAW to be the next step for the development?

I am amateur photographer and I don't plan any variants commercial use of my photos. But I want to evolve to take better pictures.  I started from the purchase of the camera Sony Nex-5 (with KIT-lens 18-55)  Then I added postprocessing of my pictures (white balance, contrast, brightness, etc.). I'm postprocessing of JPEG-files, often HDR.  Also I tried a bit of other lenses (cheap - Helios) and long-exposure.  Now I feel certain stagnation, I can't do better using the same approach.  Purchase better camera or lens would open up new possibilities, but now I cant much to spend on my hobby.  Will I get much better pictures if I start to work with RAW instead of JPEG?


Number theory question from today's Pre - RMO

How many positive integers less than 1000 have the property that the sum of the digits of each such number is divisible by 7 and the number itself is divisible by 3?


How to find only directories without subdirectories?

Is there a way in linux to look through a directory tree for only those directories that are the ends of branches (I will call them leaves here), i.e., dircetories with no subdirectories in them? I looked at  but it was never properly answered.  So if I have a directory tree  root/ ├── branch1 │   ├── branch11 │   │   └── branch111   * │   └── branch12        * └── branch2     ├── branch21        *     └── branch22         └── branch221   *   can I find only the directories that are the end of their branch (the ones marked with*), so looking only at the number of directories, not at the number of files? In my real case I am looking for the ones with files, but they're a subset of the 'leaves' that I want to find in this example.


Condition on a & b so that the two tangents drawn to the parabola $y^2=4ax$ from a point are normals to the parabola $x^2=4by$

Find the condition on a & b so that the two tangents drawn to the   parabola $y^2=4ax$ from a point are normals to the parabola $x^2=4by$   I tried finding the joint equation of tangents to the parabola $y^2=4ax$ like $SS_1=T^2$.Then I tried to apply the condition of normality to the joint pair of straight lines.But its becoming too huge.Please let me know if you can think of a shorter and more elegant method to prove $a^2>8b^2$.Thanks.


What are the effects of the various Protectron Personality Modes?

When activating a protectron in Fallout 4 you get the chance to choose its Personality Mode. The available modes are:     Default Subway Steward Law Enforcement Fire Brigadier Medical Responder Construction Worker   Do these modes serve any purpose ? Is there any actual difference in the protectron behavior ?


Can I identify and learn the properties of a magic item that I can't attune to without using the identify spell?

If I have an item I can't attune to, (e.g. a Dwarvern Thrower for a non dwarf or a robe of the Archmagi if I'm not a Spellcaster): can I still find out what it is after a short rest? I am not asking how to identify it, I'm asking if the fact I can't attune to it prevents me from identifying it.


How to use Form.AcceptButton properly when I want to use WaitCursor?

I decided to create a login form and use the Form.AcceptButton property for the first time. I have a problem with locking controls while my Login function is running.    When I hit enter to login, the form freezes before the cursor changed to the WaitCursor and the controls are locked. When I click the login button, the form freezes after the cursor changes to the WaitCursor and the controls are locked (preferred behavior).   Here is my code (simplified):  private void btnLogin_Click(object sender, EventArgs e) {     this.Cursor = Cursors.WaitCursor;      // foreach loop that sets Enabled = false on all controls on form     LockControls();       // this function tries to login to SOAP web service, sometimes it takes few seconds     Login();      this.Cursor = Cursors.Default;      // foreach loop that sets Enabled = true on all controls on form     UnlockControls();  }


How to access local Windows files in bash with Windows 10 Developer Mode?

I have enabled the Ubuntu bash command line feature that comes with Windows Developer Mode.  I cannot seem to be able to access any directories outside of a linux looking filesystem (ex. / has bin, usr, etc...) and cd / leaves me at that root folder. Perhaps there's a sandbox being used here.  How do I access local windows files, say in my Downloads or Desktop directory and use them with the Developer command line?


Approximating Riemann integrable functions

Here's a problem I encountered: Suppose $f$ is Riemann integrable (and so must be bounded) on the interval $[a,b]$. Show that given $\epsilon > 0$, there exist continuous functions $g,h$ such that $g(x) \leq f(x) \leq h(x)$ for all $x$, and $\int_a^b |g(x) - h(x)|\  dx < \epsilon$  Now my thought was to attempt was to prove something slightly stronger. Of course the following holds: $$\int_a^b |g(x) - h(x)| dx \leq \int_a^b |f(x) - g(x) | + |g(x) - h(x)|\  dx$$by triangle inequality. Then since $\epsilon$ is arbitrary, I've reduced the problem to just dealing with approximation from above or below.  Now I wanted to use a particular trick I'd seen before, since I know that Riemann integrable functions can be approximated by Lipschitz functions, which are of course continuous, the problem is that this approximation is not necessarily strictly from above or below. The proof is basically to take a sufficiently fine partition so that the Riemann sums $U(P,f) - L(P,f) < \epsilon$, and then interpolate linearly between the points of the partition. Taking the maximum of the slopes and using the triangle inequality allows you to conclude this piecewise linear guy is actually Lipschitz.  Of course this strategy won't work here though, because there's nothing that says the function can't cross over these lines frequently. In fact, that kind of wild behavior can even happen for $C^1$ functions. So I've run into trouble.  I still think that the original idea is right - if I can approximate from above, whatever scheme I use should work from below too. I'm just having a hard time figuring out how.


I have an ajax call:  jQuery.ajax({   type:'POST',   url: 'http://www.mytestsite.com/wp-admin/admin-ajax.php',   data:{        'action':'display_image',        'id_page': 9        },   success:function(data){     $('#ajax').html(data);   } });    It works perfectly my div ID "ajax" display the html code:  HELLO   The problem is in my footer page i have:  $('#test').on('click', function(){ alert('test'); });   When i click on "HELLO" (the html return of my ajax call) an alert box will display but it doesnt work. I dont know why...


Is there a Bayesian interpretation of linear regression with simultaneous L1 and L2 regularization (aka elastic net)?

It's well known that linear regression with an $l^2$ penalty is equivalent to finding the MAP estimate given a Gaussian prior on the coefficients. Similarly, using an $l^1$ penalty is equivalent to using a Laplace distribution as the prior.  It's not uncommon to use some weighted combination of $l^1$ and $l^2$ regularization. Can we say that this is equivalent to some prior distribution over the coefficients (intuitively, it seems that it must be)? Can we give this distribution a nice analytic form (maybe a mixture of Gaussian and Laplacian)? If not, why not?


Evaluating the integral of $e^{\sin x}$ from $0 \to \frac{\pi}{2}$

$$ \xi = \int_0^{\frac{\pi}{2}} e^{\sin(x)}dx $$ We can take advantage of the fact that $e^x$ has a simple McLaurin series: $$ e^x = \sum_{n=0}^\infty \frac{x^n}{n!} $$ Substituting $\sin(x)$ $$ \xi = \int_0^{\frac{\pi}{2}} \sum_{n=0}^\infty \frac{\sin^nx}{n!} dx $$ Switching the bounds of integration: $$ \xi =\sum_{n=0}^\infty \frac{1}{n!} \int_0^{\frac{\pi}{2}}\sin^nx \, dx $$ We let $$ I_n = \int_0^{\frac{\pi}{2}}\sin^nx \, dx = \int_0^{\frac{\pi}{2}}\sin^{n-1}x \sin x\, dx $$ Using integration by parts: $$ I_n = \left[-\sin^{n-1}x \cos x \right]_0^{\frac{\pi}{2}} + (n-1)\int_0^{\frac{\pi}{2}}\left( \sin^{n-2}x - \sin^{n}x\right) $$ $$ I_n = \frac{n-1}{n}I_{n-2} $$ We can see that we get different results when $n$ is odd or even. We know that $I_0 = \frac{\pi}{2}$ and $I_1 =1$. So for any $n$ we have: $$ \begin{cases} n \,\textrm{even}\, , \quad I_{2n} = \frac{\pi}{2} \prod_{k=1}^n \frac{2k-1}{2k}\\ n \,\textrm{odd}\, , \quad I_{2n+1} =  \prod_{k=1}^n \frac{2k}{2k+1} \end{cases} $$ We can now use this for $\int_0^{\frac{\pi}{2}}\sin^nx$ in $\xi$: $$ \xi = \sum_{n=0}^\infty \left[\frac{\pi}{2(2n)!}\prod_{k=1}^n \frac{2k-1}{2k} \right] + \sum_{n=0}^\infty \left[\frac{1}{(2n+1)!}\prod_{k=1}^n \frac{2k}{2k+1} \right] $$ Merging: $$ \int_0^{\frac{\pi}{2}} e^{\sin(x)}dx = \sum_{n=0}^\infty \left[\frac{\pi}{2(2n)!}\prod_{k=1}^n \frac{2k-1}{2k} + \frac{1}{(2n+1)!}\prod_{k=1}^n \frac{2k}{2k+1} \right] $$


Fixing scrolling in nano running in tmux in mate-terminal

The problem:   I open a terminal (in Linux Mint, so mate-terminal) zsh is the shell Then I run tmux Edit a file with nano Scroll up and down that file with the cursor Issue: When scrolling down in nano, only the bottom half of the terminal window gets refreshed Issue: When scrolling up in nano, only the top half of the terminal windo gets refreshed   The complete nano view of file does not get refreshed in my terminal window when scrolling. Any tips?  Edit: my .tmux.conf  It seems that this line specifically is the culprit (as commenting it out fixes the problem):  set -g default-terminal "xterm-256color"   I'm pretty sure I added that line because I have issues even running nano during an SSH session.  Here is the full file:  set-option -g default-shell /bin/zsh  # Make sure tmux knows we're using 256 colours, for # correct colourised output set -g default-terminal "xterm-256color"  # The following were marked as "unknown", so # I do know what I'm doing wrong. #set -g mode-mouse on #setw -g mouse-select-window on #setw -g mouse-select-pane on  # Attempting to stop "alert" sound upon startup # but none of these are working... set-option bell-on-alert off set-option bell-action none set-option visual-bell off


UnboundLocalError: local variable referenced before assignment in Python

so i faced strange behaviour with this code below. I am getting error that local variable flag is referenced before assignment, but its assigned at the top as global variable. Can someone tell me whats going here and why flag is not incrementing as expected?  import concurrent.futures   flag = 0 def make_some():     try:         flag += 1     except Exception as e:         print(e)  with concurrent.futures.ThreadPoolExecutor(max_workers=3) as executor:     tasks = {         executor.submit(             make_some         ): task_id         for task_id in [1,2,3]     }     for future in concurrent.futures.as_completed(tasks):         pass


I currently have a iMac (27-inch, Late 2009, Intel Core 2 Duo) which I would like to use as display for a new Mac Pro. How do I do that?


I am a PhD student designing algorithms for mathematical problems. I have the very bad habit of loosing my track on research problems. Suppose I am working on problem X, then, in the next week, I will start looking at Y,Z and other problems. Due to this, I feel tired at the end of the day with very less productivity with respect to X. I have always fear in my mind of failing, and that's why I try to look at other problems simultaneously. I don't know if it is okay for a PhD student (after mid-stage) to do this kind of things.  Question: How to focus only on the problem at hand?


Slow service response Times : Java SecureRandom & /dev/random

I am trying to debug a few slow responses served by an app deployed on Tomcat. Right now I am focussing on SecureRandom and /dev/random (some of the other probable causes have been investigated and ruled out). The pattern is as follows:   The first call takes exactly 30.0xy seconds after Tomcat restart (even if the request arrives 4 minutes after the Startup) Later, some calls take exactly 15.0pq seconds (there was no specific pattern that I could establish, pq being the time approximate time taken in TP99)   The service call involves encryption and decryption (AES/ECB/PKCS5Padding).  Is it possible that SecureRandom init/repopulating is leading to this?  (Although, there is a log written in catalina.log that says "Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [28,760] milliseconds.")  Also, in order to check whether /dev/random or /dev/urandom is being used, I used the test from . To my surprise, I didn't see reads from either of them unlike the way it happens in the linked question. These are the last few lines from the strace log:  3561  lstat("/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jsse.jar", {st_mode=S_IFREG|0644, st_size=258525, ...}) = 0 3561  open("/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jsse.jar", O_RDONLY) = 6 3561  stat("/dev/random", {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 8), ...}) = 0 3561  stat("/dev/urandom", {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0 3561  open("/dev/random", O_RDONLY)     = 7 3561  open("/dev/urandom", O_RDONLY)    = 8 3561  unlink("/tmp/hsperfdata_xxxx/3560") = 0   What is then being used for seeding SecureRandom?  fyi, java -version  java version "1.6.0_32" OpenJDK Runtime Environment (IcedTea6 1.13.4) (rhel-7.1.13.4.el6_5-x86_64) OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)


One of the services I run is a simple email service that lets people send emails from their own websites.  Because it's only a simple email thing, I didn't want to  have to install an email client software package such as RoundCube. Instead, I made my own editor, using Markdown.  Why? I thought, because WYSIWYG editors produce such bad markup, I'd use Markdown backed up on the server-side instead.  The question is, is this use of Markdown both effective and accessible? Do I need to do anything to explain how it works to users and that all the extra characters don't appear in the final email? Would I be better using a WYSIWYG editor or even a software package?


Is it correct to use "at" followed by a place name (city, town, village, etc.)? I've been seeing phrases like "a hotel at Las Vegas" or "she was living at London" quite a lot recently. Is this a difference between British and US English, perhaps?


How to Find All Defaultly Installed Packages on Ubuntu 16.04.3

Is there any way I can find all the default installed packages for a given Ubuntu version, like Xubuntu 16.04.3 x86? I'm not talking about the list of the packages currently installed on the system but the packages which you'll find installed after a clean install.


where to find previous versions in official website

i cant find how to install the .ISO file of ubuntu 16.04. it shows me only the 18.04 version. thank you.


What is the difference between the following commands:  su sudo -s sudo -i sudo bash   I know for su I need to know the root password, and for sudo I have to be in the sudoers file, but once executed what is difference?  I know there is a difference between su and sudo -s because my home directory is /root after I execute su, but my home directory is still /home/myname after sudo -s. But I suspect this is just a symptom of an underlying difference that I'm missing.


Bad if I use a Higher power adapter for a keyboard instrument requiring lower power and amps?

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


How to change a primitive's properties after creating it?

I want to model a pistol like this for my FPS:    You can see how the cylinder for the front of the barrel is very low poly. How do I make a cylinder less low poly? Or even a sphere, anything?


When I press Ctrl +  F12 to render animation Blender outputs images to folder. That's nice. But it fails to do that when I press  F12. It's very annoying when - for example - I want to manually re-render couple of frames that were broken for some reason when rendering full animation. Sure, I can manually save them, but I have to input frame name and that makes it error-prone and annoying. Sure I can change animation range to do this, but that's also annoying. I know I can write a script to render whatever frames I want, but that's also a bit of work that I hope could be avoided.


Downloading code from Google Code without using a version control system

Is there a method to download a folder from Google Code without having to use the version control system?


I need to enable shell escape for a package that I want to use. What is shell escape exactly, and how do I enable it in my editor or compiling toolchain? Links to answers for different editors/toolchains, in alphabetical order:   AUCTeX (Emacs) ,         Note: this is a FAQ post. Related Meta question: . Please add an answer for your own editor/toolchain if it is missing. Thank you! When adding an answer, please indicate if the setting is permanent or per-document, and/or describe how you can add a button, shortcut, menu item, etc. to make it easy to switch between shell-escape and regular compilation.


Java installation error on ubuntu 16.04 server edision

How can I proceed further to install java  Environment: 16.04 Server Edision  test@ubuntu:~$ java -version  The program 'java' can be found in the following packages:  * default-jre  * gcj-5-jre-headless  * openjdk-8-jre-headless  * gcj-4.8-jre-headless  * gcj-4.9-jre-headless  * openjdk-9-jre-headless Try: sudo apt install <selected package>


I updated from Ubuntu 16.04 to Ubuntu 18.04 about 4 months ago and it worked properly for a while, but then I started getting a problem with a login loop. I can drop down into the command line and run commands, but I want to login into the GUI environment.   Emby was put on an old Windows 8 converted to 10 computer that I used.    ASUS M Series M51AC Tower Core i7 4770 3.4 GHz RAM 16 GB HDD 1 TB BIOS Version: 0901 SN:  XXXXXXXXXXXX    Display Hardware:   Results of lspci | grep VGA   01:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 620 OEM] (rev a1)     Kernel Driver:   Results of  find /dev -group video    /dev/dri/card0     /dev/dri/renderD128     /dev/fb0       What x.org is using:  Results of egrep -i " connected|card detect|primary dev|Setting driver" /var/log/Xorg.0.log  [    70.690] (--) NVIDIA(GPU-0): Acer X223W (CRT-1): connected [    71.191] (--) NVIDIA(GPU-0): Acer X223W (CRT-1): connected [    95.213] (--) NVIDIA(GPU-0): Acer X223W (CRT-1): connected   Linux OS:  Results of lsb_release -a    No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 18.04.3 LTS Release:        18.04 Codename:       bionic   IP Address:  Results of dig +short myip.opendns.com @resolver1.opendns.com     xx.xx.xxx.xxx   I have tried fixing this several times, but haven't been able to fix it. I do have the IP address.


The math to come to this conclusion? If we lost all the dead space inside our atoms, we would each be able to fit into a particle of lead dust

I found this on  on Symmetry Magazine:     The size of an atom is governed by the average location of its electrons. Nuclei are around 100,000 times smaller than the atoms they’re housed in. If the nucleus were the size of a peanut, the atom would be about the size of a baseball stadium. If we lost all the dead space inside our atoms, we would each be able to fit into a particle of lead dust.   Could somebody show the math to come to this conclusion?  I don't know a lot about physics but I like to learn. My question aims to asses how much I can trust the analogy in the article: The particle physics of you.


Do I "control" creatures in my graveyard?

has      Exile target creature you control, then return that card to the battlefield under your control.   Are creatures already in my graveyard still under my control? Can I return one of them to the battlefield?  (No, I don't think  answers my question. It's not "permanent", but "creature you control")


Can I leave South Korea to reset the 90 days visa counter?

My friend tells me that I can leave South Korea for 1 night and re-enter, to reset my 90 days. For example, an American could enter Korea and stay for 90 days and then go to Japan or China (any place outside of Korea), and return to Korea and have the passport stamped for another 90 days. He tells me that a lot people have been doing it for years. Is it legal?  I have a U.S. citizenship and I've been staying in Korea since January 17th. I'm supposed to return on the 13th of April, but I have a grad school audition that came up unexpectedly that's in May. So I was wondering if it would be okay if I moved my returning ticket to sometime after my audition in May, and go to Japan for a night or two in April and come back to Korea.


How do i select an object that is separated from other objects

I was watching a tutorial on texturing. There was shown a way to separate the glass part of the windows so you won't keep on clicking on them while you're texturing which I admit made things a lot easier.  Now I want to work on texturing my windows but I have no idea on how to select them. They aren't on a different layer. If there is a clip board option on here I haven't found it yet.


What is the difference between a hash function and a pseudorandom function?

Read the title. I've seen in RFCs that some MAC functions are called "pseudorandom functions". What are those? How are they different than hash functions? Why can't a hash function be used instead?


Generating a cryptographically secure, many-time use, symmetric encryption key

I need to generate a 256 bit encryption key described by the adjectives in the title. Currently I intend to create the key using this .  Is this a secure manner of creating the key, given that it has the following properties:   Private key for symmetric encryption Used many times (of course with unique IV's)   And given the following facts:   I will literally just get the RNG to produce 32 random bytes not doing anything with (1) SALT (2) Iterations (3) Anything else   Please note that I am only asking if the key, directly after being generated, is secure. Thanks


This question has been rounding my head for a while, id say help me cook but then  i think about omitting "to" which i think isn't correct. Can you give me more examples about this situation.   Thanks in advance


direction of association (beta value) using lm in R

I want to get the direction of association from a linear model (beta value) using the "lm" function in R. How do I get that? I've used the following:  m <- lm( X ~  Y ) s <- summary(m)   When I print the output of summary(m) I get this:  Call: lm(formula = X ~ Y)  Residuals:       Min        1Q    Median        3Q       Max  -0.077047 -0.009917  0.001262  0.010990  0.031181   Coefficients:                       Estimate Std. Error  t value Pr(>|t|)     (Intercept)          0.9449522  0.0009249 1021.715   <2e-16 *** Y                   -0.0004059  0.0015299   -0.265    0.791     --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  Residual standard error: 0.01494 on 351 degrees of freedom   (6 observations deleted due to missingness) Multiple R-squared:  0.0002005, Adjusted R-squared:  -0.002648  F-statistic: 0.07039 on 1 and 351 DF,  p-value: 0.7909   Which of these parameters corresponds to beta (direction of association between X and Y?  Thanks,


Create new object while creating a new method, how is this possible?

So I was looking at a tutorial and saw this line of code:  Thread timer = new Thread() {   @Override    public void run(){     // etc....   } }   What is happening here? They are creating a new object of the Thread class and declaring the method run when creating that object? How is this possible? My understanding was that an object got its methods from its class?


How can I transfer Thunderbird profile from Windows XP?

I've saved the profile on a flash drive by using the Import/Export feature of the Windows Thunderbird. However, the Thunderbird in Ubuntu seems to be a reduced version of the Windows one.   In the Import wizard under the prompt: "please select the type of file to import" it is not possible to enter anything, so I cannot direct the wizard to the saved profile (exported from the laptop).   Also, I don't want to do a profile replacement, as I've got some emails in the Thunderbird on Ubuntu and wouldn't like them to be overwritten. Please note the desktop Thunderbird is set to IMAP, whereas the laptop Thunderbird contains old emails and is not connected to the server.


Logistic regression vs. LDA as two-class classifiers

I am trying to wrap my head around the statistical difference between Linear discriminant analysis and Logistic regression. Is my understanding right that, for a two class classification problem, LDA predicts two normal density functions (one for each class) that creates a linear boundary where they intersect, whereas logistic regression only predicts the log-odd function between the two classes, which creates a boundary but does not assume density functions for each class?


Solve for $A,B$: $\mathrm{LCM}(A,B)=168$, $\mathrm{HCF(A,B)}=12$

The highest common factor and the lowest common multiple of two numbers $A$ and $B$ are $12$ and $168$ respectively. Find the possible values of $A$ and $B$ with the exception of $12$ and $168$.   Help me with this equation please. I kind of get it but I don't understand the concept behind it... I do not want to memorize.


I've seen a lot of questions about what is shallow vs deep copy, but not a lot on when to use each. If deep copy is safer, why aren't more developers deep copying every single object every time something is changed? If that were done, doesn't performance become an issue? Is there ever a good time to shallow copy?  Edit - This question is not a duplicate of the one provided. That question asks what is the difference between the two. This question is asking in what scenario is it appropriate to use each one, I understand the differences.  Edit - The question is if a server is receiving requests and adding or modifying one field, should the server map the json request to object, then map every single field from that object to new objects with the one field modified then forward the request to a second api? Or is a shallow copy sufficient since there's not really a chance of the original object being modified?


How can I setup a portable QGIS to run from a flash drive / USB-Stick? In the userguide for QGIS 1.7 Wroclaw there is only mentioned the option of "--configpath". But to me it is not clear how to deal with this information.  Can someone post a step-by-step explanation!


physical meaning of the vector $(A \cdot \nabla) A$

If we consider the vector $\left ( A \cdot \nabla \right) \: B$, we have in Cartesian coordinates  $$\left ( A \cdot \nabla \right) \: B = \left ( A \cdot \nabla B_x \right ) e_x + \left ( A \cdot \nabla B_y \right ) e_y + \left ( A \cdot \nabla B_z \right ) e_z,$$ which gives in full writing:  $$\left ( A \cdot \nabla \right) \: B = \left (A_x \frac{\partial \: B_x}{\partial \: x} + A_y \frac{\partial \: B_x}{\partial \: y} + A_z \frac{\partial \: B_x}{\partial \: z} \right )e_x + \left (A_x \frac{\partial \: B_y}{\partial \: x} + A_y \frac{\partial \: B_y}{\partial \: y} + A_z \frac{\partial \: B_y}{\partial \: z} \right )e_y + \left (A_x \frac{\partial \: B_z}{\partial \: x} + A_y \frac{\partial \: B_z}{\partial \: y} + A_z \frac{\partial \: B_z}{\partial \: z} \right )e_z$$   Now, if $B=A$ and $A=\left (0, \: 0, \: A_z \right )$ (i.e. $A_x=A_y=0$), we have from the above definition, only the following term along the unit vector $e_z$:  $$\left ( A \cdot \nabla \right) \: A = A_z \frac{\partial \: A_z}{\partial \: z}$$  But this is equal to zero since $\frac{\partial A_z}{\partial \: z}=0$, despite $A_z \neq 0$.  So we get $$\left ( A \cdot \nabla \right) \: A =0$$  I would like to know the physical interpretation of this result. What is the significance of this vector being zero in terms of field lines?  Thanks a lot...


A proof that $\mathbb{Z}[\frac{1 +i\sqrt{19}}{2}]$ is not Euclidean.

I've encountered several proofs that $A = \mathbb{Z}[\frac{1 +i\sqrt{19}}{2}]$ is indeed a PID that is not euclidean. I'm quite confused with this one, which seems to be nonetheless using similar arguments. We consider that $A$ is euclidean, therefore it features a euclidean function $\nu$. Let $x \neq 0$ non-unit such that $\nu(x)$ is minimal, and let $\bar{y} \neq 0$ an element of the quotient space $A/(x)$. By definition of $x$, it is clear that if $y = qx + r$, then $r$ must be invertible, so $r = 1$ or $r = -1$ (because $\nu(r) < \nu(x)$).   From that we deduce that either $A \simeq \mathbb{F}_2$ or $A \simeq \mathbb{F}_3$. I'm not totally confident with this first fact. Indeed, it seems the only possible remainder (i.e. elements of $A/(x)$) are $0, 1, -1$. Either everyone of them is possible, and $A \simeq \mathbb{F}_3$, or only two of them occur ($0$ and $1$ for instance) and $A \simeq \mathbb{F}_2$. But when I tried writing actual proofs, I ended up proving the hypothesis (that $A$ is euclidian) is false.  (1) If $A  \simeq \mathbb{F}_2$, then $\bar{y}$ is a root of $T^2 + T + 1 \in A[T]$.  (2) If $A \simeq \mathbb{F}_3$ then $\bar{y}$ is a root of $T^2 - T - 1 \in A[T]$.  Both statements are allegedly contradictory, which seems wrong to me. ($\bar{y} \neq 0$, then $\bar{y} = 1 \in \mathbb{F}_2$, and clearly (1) is not satisfied.)


I'm stuck on how to sanitize the code below for SQL injections.   Line 3 is where I'm stuck and put ??? for the value I'm not sure of. I'd also appreciate if someone can review the entire thing to check if I made other mistakes.  $path will look something like /1/A/2/B/3/C/  1 $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); 2 $stmt = $db->prepare("SELECT * FROM table WHERE path = :path"); 3 $path = filter_input(???, 'path', FILTER_SANITIZE_STRING); 4 $post->bindParam(':path', $path, PDO::PARAM_STR); 5 $post->execute();


Clipping Out Many Villages from geotiff image using rasterio?

I have a geo tiff image of a County/State consisting of useful bands data. I have a kml/geojson file consisting of many small territories' boundaries inside this State/County. I would like to clip geotiff Image at all small territories and export it as a tiff. I cant clip each small sub-territory manually as there are around few thousands of them.  How this can be accomplished in rasterio?


Should I flag this kind of copy+paste answer?

This  really don't make sense and I think I should flag this, but if I should flag this answer what is the right flag? User just copy+pasted code from questioners post, exactly same code.


Let $f ∈ L_1([0,1])$ be a function such that $\int_E f(x)dx = 0$ for any measurable set $E ⊂ [0,1]$ of Lebesgue measure $0.99.$ Prove that $f = 0$ a.e.  Not sure how to start this question.  Any suggestions?


Three different time values when using traceroute

I'm learning networking troubleshooting and noticed how there are three different time values outputted for every hop when using traceroute, what do they mean? (The left CLI in the image is a router and the right is a Windows CLI)


Are there infinitely many prime numbers?

I will post my own answer below. That should not deter others from answering.  There are many ways to prove this.


Maybe an illegal question. Sorry.  Having read that a photon has both wave and a light characteristics it is natural for a novice like myself to wonder "what is the amplitude? "  Naturally I have looked on wiki and other sources and there are a number of answers some of which appear not so much to contradict one another of varying opinions of which is the most meaningful in physics.   I seem to get a higher number of physics sources saying the amplitude depends on how many photons you have and if you have one the question has no meaning.  Of course I have not idea if this is accurate or how one would even test this.   Maybe there are some physics teachers in the audience that can give me a layman's intuition with a little math tossed in.


I want to put a space between the paragraph header and the paragraph itself. But all I have tried so far, didn't work. Using \paragraph the header and the body are in the same line, whereas I want to skip at least a line between the header and the body of paragraph.  \documentclass[oneside,12pt]{book}      \usepackage[french]{babel}  \usepackage[utf8]{inputenc}  \usepackage[T1]{fontenc}  \begin{document}  \section{section} \subsection{subsection} \subsubsection{subsubsection} \paragraph{the header} \vspace{1cm} % I want to skip a line or add space between header and the body of paragraph body of the paragraph  \end{document}   I am using a book document, for all the answers I have seen so far are for article document or for scrbook document.


Is it necessary to use an IV in CBC mode when just encrypting one file?

As far as I know, CBC mode, even with a null IV, will encrypt identical plaintext blocks to unique ciphertext blocks within a single file. The purpose of an IV is to obscure the similarities between multiple ciphertexts, not to obscure the similarities within a single ciphertext. So, would it be just as effective to use a null IV as it would be to use a random IV when encrypting a single file? As far as I see it, it's just one less value to store.


Thread safety access to edit collection like BlockingCollection

I have multithread readers/writers that use shared collection.  foreach (var account in accounts) {   ThreadPool.QueueUserWorkItem(o => Execute(account)); }   in Execute Method I read static Dictionary, get first record where value is null and block it.  do {   if (collection.Any(x => x.Value == null))       {           var wall = collection.First(x => x.Value == null).Key;           collection[wall] = 0; //block           //Do something           Console.Write(wall);           collection[wall] = result;       }  } while (collection.Any(x => x.Value == null));   In result in console I get all walls that thread visited:  thread 1 : ABDFH  thread 2 : ACEFG  I read , but BlockingCollection using to block unsafety add or delete element, how to thread-safety change collection? I use .NET 4.0.


How would you define the relation between (for example) "Italian" and "languages"?

I'm building a web site where I have a list of topics, and I need to denote the relation between them. e.g.:    Topic: Italian. Ancestors: Languages -> European Predecessors: Verbs, Nouns...    Another example may be:    Topic: Internet Explorer. Ancestors: Software -> Browsers Predecessors: Menus, Add-Ons, keyboard-shortcuts...     And so on.  The problem is that I'm not sure "Ancestors" and "predecessors" are suitable.    Other options I had in mind are subtopics/supertopics, and children/parents.    What do you think? Which way articulates the meaning best?


I've done   sudo apt install conky-all cp /etc/conky/conky.conf ~/.conkyrc sudo apt-add-repository -y ppa:teejee2008/ppa sudo apt update   and then;   sudo apt install conky-manager   I get;  Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package conky-manager   How can I overcome this problem?Why I am unable to locate the package?


Devise a test for divisibility of an integer by 11, in terms of properties of its digits

Using the fact that $10 \equiv-1 \pmod{11}$, devise a test for divisibility of an integer by $11$, in terms of properties of its digits.   Approach:  Let the number with its digits $a_0\cdots a_n$ be represented as $f(x)=a_0x^n+\cdots+a_n$. By exhaustion $f(-1)=0$ if the number is divisible by $11$, so $f(10)$ is divisible by $11$. Do I have to prove my conjecture? or it's trivial.


Android Nullpointerexception on Recyclerview after switching fragments back and forth

I have a navigation drawer app with couple fragments. One of them utilizes recyclerviewadapter/recyclerviewholder to display items. Switching between fragments works well but AFTER switching, clicking on an item with listener causes nullpointerexception. Now, I tested it without the listener and it works fine. I'm guessing that the listener isn't refreshed? when fragment is swiping? Can someone help me out please? Been searching for days and yet I can't fix it.     Process: com.mikepenz.materialdrawer.app.debug, PID: 30803                                                                                java.lang.NullPointerException: Attempt to invoke interface method   'void   com.mikepenz.materialdrawer.app.RecyclerViewAdapter$OnItemClickListener.onItemClick(java.lang.String)'   on a null object reference                                                                                at   com.mikepenz.materialdrawer.app.RecyclerViewAdapter$1.onClick(RecyclerViewAdapter.java:43)                                                                                at android.view.View.performClick(View.java:5198)                                                                                at android.view.View$PerformClick.run(View.java:21147)                                                                                at android.os.Handler.handleCallback(Handler.java:739)                                                                                at android.os.Handler.dispatchMessage(Handler.java:95)                                                                                at android.os.Looper.loop(Looper.java:148)                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417)                                                                                at java.lang.reflect.Method.invoke(Native Method)                                                                                at   com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)   public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewHolders> {  private List<ItemObject> itemList; private Context context; private OnItemClickListener listener;   public RecyclerViewAdapter(Context context, List<ItemObject> itemList) {     this.itemList = itemList;     this.context = context; }  @Override public RecyclerViewHolders onCreateViewHolder(ViewGroup parent, int viewType) {      View layoutView = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_view_list, null);     RecyclerViewHolders rcv = new RecyclerViewHolders(layoutView, context);     return rcv; }  @Override public void onBindViewHolder(RecyclerViewHolders holder, final int position) {     holder.countryName.setText(itemList.get(position).getName()); //    holder.countryPhoto.setImageResource(itemList.get(position).getPhoto());      holder.countryName.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {       //    listener.onItemClick(itemList.get(position).getName());              Log.d("HELLO   ",itemList.get(position).getName());             if (position ==1)             {                 listener.onItemClick("GA");             }         }     });  }   public interface OnItemClickListener{      void onItemClick(String textName); }  public void setOnItemClickListener(OnItemClickListener listener){     this.listener = listener; }   @Override public int getItemCount() {     Log.e("itemlist size ", this.itemList.size() + "");     return this.itemList.size(); }   }


Some integral representations of the Euler–Mascheroni constant

What kind of substitution should I use to obtain the following integrals? $$\begin{align} \int_0^1 \ln \ln \left(\frac{1}{x}\right)\,dx &=\int_0^\infty e^{-x} \ln x\,dx\tag1\\ &=\int_0^\infty \left(\frac{1}{xe^x} - \frac{1}{e^x-1} \right)\,dx\tag2\\ &=-\int_0^1 \left(\frac{1}{1-x} + \frac{1}{\ln x} \right)\,dx\tag3\\ &=\int_0^\infty \left( e^{-x} - \frac{1}{1+x^k} \right)\,\frac{dx}{x},\qquad k>0\tag4\\ \end{align}$$  This is not homework problems and I know that the above integrals equal to negative of the Euler–Mascheroni constant. I got these integrals while reading this Wikipedia page: . According to Wikipedia, the Euler–Mascheroni constant is defined as the limiting difference between the harmonic series and the natural logarithm: $$\gamma=\lim_{N\to\infty} \left(\sum_{k=1}^N \frac{1}{k} - \ln N\right)$$ but I don't know why can this definition be associated to the above integrals?  I can obtain the equation $(1)$ using substitution $t=\ln \left(\frac{1}{x}\right)\rightarrow x=e^{-t} \rightarrow dx=-e^{-t}\,dt$ and I know that $$\int_0^\infty e^{-x} \ln x\,dx=\Gamma'(1)=\Gamma(1)\psi(1)=-\gamma$$ but I can't obtain the rest. Any idea? Any help would be appreciated. Thanks in advance.


Clarification about a bounty assignement?

On this recent , a user placed a 500 rp bounty.  The question has attracted four answers of which 3 shows the same net amount of upvotes.   The user didn't choose any of the answers and let the system assign the bounty.  I know that in this case only half of the bounty is given to the answer with more upvotes, but in this case, it is not clear to me why the bounty was assigned to one of the answers which has the same upvotes as the other two.  Can anybody help me understand the dynamics behind this?


I have 3/8" wire that needs to be tight (not sagging) between two wooden posts with screw eyes. I don't want to purchase turnbuckles if I don't have to.  How can I pull them and then secure it with a crimp sleeve?  This is different to the other question because in the other one I was asking about regular polyester rope.


I am working with example code from Stroustrup's book(Programming: Principles and Practice using C++").I have downloaded std_lib_facilities.h from   http://www.stroustrup.com/Programming/std_lib_facilities.h   When I try to compile on Ubuntu 14.04 with gcc,I got this:  d19.cc:1:32: fatal error: std_lib_facilities.h: No such file or directory  #include <std_lib_facilities.h>   Then I have doublechecked,file is in my directory.  milenko@milenko-HP-Compaq-6830s:~/cplus$ ls -l std_lib_facilities.h  -rw-r----- 1 milenko milenko 5667 Jul  4 09:35 std_lib_facilities.h   I have changed <> to "" and works fine,but still lingers a question why do we use <iostream> and  "std_lib_facilities.h"


Parselmouths other than Harry and the Slytherins

Aside from Harry and those of the Slytherin bloodline, were there other characters that could speak the language of the snakes?


Can't change the size of particles in particle physics settings

I was trying to increase size of particles in a particle system by adjusting the size property in physics settings as seen in the tutorial I was watching.But that setting is not available to me.Could any one tell where I went wrong ? and how to solve it ? Thanks in advance ( Blender v2.79 )


I'm trying to change the value of static variable that I passed to Klasa.method() function and sadly return value is ignored. package com.company;  public class Klasa {     public static int metoda(int x){         x += 2;         return x;     }  }  public class Main {     public static int i = 10;      public static void main(String... args) {         System.out.println(Main.i);         Klasa.metoda(i);         System.out.println(Klasa.metoda(i));         System.out.println(i);     } }


fancyhdr plus fontsize 12pt causes varying vertical alignment of sections

Looking at the example provided in , I noticed something strange: The vertical alignment of sections is varying. I was able to strip the effect down to the following (hopefully minimal) example:  \documentclass[12pt]{report}  \usepackage{fancyhdr} \pagestyle{fancy}  \begin{document}  \chapter{My First Chapter} \clearpage \section{Section 1} \clearpage \section{Section 2} \clearpage \section{Section 3}  \end{document}   If you look closely, the vertical alignment of "Section 1" differs from those of "Section 2" and "Section 3" (which are the same). The effect disappears if you either a) refrain from using the fancyhdr package and \pagestyle{fancy} or b) switch to the 10pt class option. What is causing this strange vertical alignment?


Why calculating XOR of consecutive values can be simplified?

I was trying to calculate integer xor of 0..n. I named the function xored(n).  Note that in examples below ^ does not mean power but integer xor (like in C or Java language)  So, xored(0) = 0, xored(1) = 0 ^ 1, xored(2) = 0 ^ 1 ^ 2, xored(3) = 0 ^ 1 ^ 2 ^ 3, etc... Or, if you prefer recursive definition: xored(0) = 0 xored(n) = n ^ xored(n-1)    First, I created a naive implementation that that loops through the values and xors them together.  Then, I noticed a funny thing. I noticed a pattern with my results.  All you need to do is to calculate n modulo 4 (call it m) then: if m = 0, xored(n) = n if m = 1, xored(n) = 1 if m = 2, xored(n) = n + 1 if m = 3, xored(n) = 0    My question is. Why does it work? How can this be proven mathematically? I am not good at proving theorems...


Bisecting line segments in a tetrahedron.

Suppose that $OABC$ is a regular tetrahedron with base $ABC$. Suppose further that $T$ is the mid-edge of $AC$, $Q$ is the mid-edge of $OB$, $P$ is the mid-edge of $OA$, and $U$ is the mid-edge of $CB$.  How can one show that $QT$ bisects $PU$?


Preface: I am an absolute novice with Linux, please don't judge strictly.   I have a directory containing several images (over 100) of a .pnm extension. I wish to rename them in such a sense, that their names should be "img1.pnm", "img2.pnm", "img3.pnm", etc. So they should have a common part in their names––"img" and different indicies running from "1".  How can I do this?


Why does finding the $x$ that maximizes $\ln(f(x))$ is the same as finding the $x$ that maximizes $f(x)$?

I'm reading about maximum likelihood .  In the last paragraph of the first page, it says:    Why does the value of $p$ that maximizes $\log L(p;3)$ is the same $p$ that maximizes $L(p;3)$. The fact that it mentions that log is an increasing function does not help me understand it at all. Does this method work for any increasing function?  I've covered single and two variable optimization but have not come across this fact until now. I'd like to understand why it must be true and read more about its explanation. So, I would also appreciate it if someone can provide some links to it (I don't know what term to search).


Does the limit $\lim_{(x,y)\to (0,0)} \frac { \sin^2 (x-y)}{|x|+|y|}$ exist?

I'm supposed to check if the function defined the same as the one in the limit can be expanded to be defined (and continuous) at $(0,0)$. I think the limit is zero, because $$\lim_{(x,y)\to (0,0)} \frac { \sin^2(x-y)}{|x|+|y|} = \lim_{(x,y)\to (0,0)} \frac { \sin^2 (x-y)}{(x-y)^2}\frac{(x-y)^2}{|x|+|y|}$$ and the left multiple approaches 1 as $(x,y)\to (0,0)$, while the right multiple approaches 0, following this reasoning: $$0 \leq \frac{x^2+y^2-2xy}{|x|+|y|} \leq \frac{x^2}{|x|}+ \frac{y^2}{|y|} - \frac{2xy}{|x|+|y|}$$ On the right hand side, the first two summands approach 0 as $(x,y)\to (0,0)$, obviously, and the third one approaches zero because (and this is the part I'm not sure about): $$y \leq \max \{x, y\} \leq |x|+|y| \space \implies -1 \leq \frac{y}{|x|+|y|} \leq 1\land \space 2x\to 0 , (x, y) \to(0,0).$$ I'm very inexperienced with finding multivariable limits so I'm very unsure about what I can and can't assume, and I haven't in my limited experience encountered many problems where the limit actually exists (most of the problems want the solver to come up with a counterexample), so I'd appreciate any corrections or input on my reasoning.


Access method using object in javascript

I have a functions A B with same method in them. I want to access this method from another function. Depends upon some condition ill choose any one of version!      function A() {         var method = function() {             // do something..                 }             }      function B() {         var method = function() {             // do something..                 }             }      function other() {         // access method from function A() or B();     }   is there any way to access using objects like we do in JAVA or any other way?


Seeking block (sub-district) level boundaries for India?

I'm looking for block (sub-district) level shapefiles for India. The GADM database only has files for the 2300 Tehsils, whereas I'm looking for the about 5500 Census blocks (sub-districts) for any year possible.


How to send a message in Minecraft before rebooting the server?

I have a Ubuntu Linux Server 14.04 LTS which is running a Minecraft server. I want it to reboot every 6 hours. I have that now and after the reboot, it starts the Minecraft server.  Now what I want. I have the server console in a screen session named cds_screen. Is there a way to do something like screen -d -r cds_screen && say Server is restarting && sudo reboot? The server runs as jebg user and not as root so can anyone help me?


Monitoring network usage across different devices on lan

My internet connection has come with an upper limit on the usage after which it throttles the speed. They have provided me with a portal where they update my internet usage everyday but I have a feeling that it is not correct. I want to keep a check on the internet usage myself but I am unable to find a tool to help me do so. I have a router through which we use wired as well as some wireless devices including smart phones - both iphones and android as also windows and linux laptop. The router is a belkin router (model F7D2301 v1). I could not find any ddwrt firmware support for this model and also no other firmware that could help me. Can SNMP help? How do I find out if the router supports SNMP? Any other application using which I can monitor network bandwidth usage?


GeoServer DescribeFeatureType response missing attribute for GML only

We have a GeoServer 2.18.2 instance serving data from PostGIS that seems to return a different structure for DescribeFeatureType requests depending on the outputFormat specified in the request. One of our database tables which is published via GeoServer has 7 column names: [id, geom, code, name, enw, inset_no, category], nothing out of the ordinary. Making a WFS DescribeFeatureType to GeoServer for this and including outputFormat=application/json provides a complete description of the feature including all of the above attributes from the underlying table. However, if outputFormat is omitted so that GeoServer returns a GML3.2 response, then the name attribute is completely missing from the result. There are no errors in the log from GeoServer when making these requests and any GetFeature requests against the same data source include the name attribute as expected. It is only DescribeFeatureType requests that seem to be affected, which causes a problem for some clients such as QGIS that use a DescribeFeatureType call to set up a layer. Prefixing the database column and reloading the feature type in GeoServer makes the attribute appear in responses but this feels like a workaround. Is this expected behaviour from GeoServer or am I seeing a bug?


I think I found a bug in /etc/grub.d/10_linux

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


Evaluate $\binom{n}{1} + 2\binom{n}{2} + 3 \binom{n}{3}+...+ n \binom{n}{n}$

Evaluate  $$\binom{n}{1} + 2\binom{n}{2} + 3 \binom{n}{3}+...+ n \binom{n}{n}$$ My attempt : I know  $(a+b) ^n = \sum\limits_{k=0}^{n} \binom{n}{k} a^{n-k}b^k$ But here Im confuse how to evaluate and im not able to proceed further.


How to get a list of all pending security updates?

I need to list (not count or install) all pending security updates on an Ubuntu 14.04 system.  I've read the post  and its accepted answer (apt-show-versions | grep upgradeable | grep security) does indeed give me a list.  However, that command lists 62 pending security updates.  /usr/lib/update-notifier/apt-check tells me that I have 75 pending security updates, but doesn't seem to have a way to list them.  How can I reconcile these two numbers?  Is one of the two commands doing something other than what I want?


How to upgrade from Ubuntu 18.04.1 LTS to Ubuntu 18.04.4? My server doesn't have accessibility to internet.


Construction "to his being offered" needs explanation

This sentence is from  about Michael K. Williams from "The Wire".     The scar led to his being offered roles as a thug in music videos.   As I see it, the word being is either a synonym for person, or it is an auxilliary verb to create Passive Voice. But in the case of Passive Voice, personally to me the word him would sound more correct than his: "led to him being offered". Can you explain this structure?


How does one insert a newline character into a cell of an Excel spreadsheet?  Up until now I have been copying and pasting the newline from a spreadsheet that already has one.   I am using Office 2003 but I hope that the solution will not be version specific.  But there must be a 'proper' way to do it.


Is it physically possible for gravity to accelerate an object with mass to the speed of light?

Is it physically possible for an object to achieve the speed of light if it is in a gravitational field strong enough and the mass does not collide before it attains a velocity of $c$? It is true that the mass of the object approaches infinity as its speed approaches $c$, but maybe there could be an (almost) infinitely powerful gravitational field (increasing in strength as the mass speeds up) originating from a very long distance away, which could accelerate the mass to this impossible speed? I ask this because it appears that you would not need an infinite amount of fuel for taking the object to the speed of light.


Double Javascript Alert when ticking Community Wiki for self answer

I discovered this yesterday when i was making a Meta post on Anime and Manga.SE and i just did a test on Stack Overflow.SE's Meta and right here (after remembering i forgot to report it).  In Chrome When you go to "Ask Question" and tick "Answer your own question" then tick "community wiki" you get what i'm quite sure is a Javascript Alert box warning you about how by making a Community Wiki you remove explicit ownership of the answer, bla, bla, bla.  Regardless if you click "Ok" or "Cancel" it appears a second time. don't know if it occurs in any other browser. kinda minor but a bug is a bug and i would think there are some people are twitching uncontrollably because of it.


Batch File Renaming Stopped Working Properly

thanks for taking the time to read this post. I have almost no experience with coding so I need some help. For the past few years I've been using the following (along with ImageMagick) to convert and rename certain images. Here's the following code: cd "D:\Pics4Web"  if exist R1_0000.tga convert backup\Work_TB_Star_Background_Still.jpg ( R1_0000.tga -resize !1920x1080 ) -composite -format jpg -quality 90 "Workplace TB %date:~-4,4%-%date:~-10,2%-%date:~-7,2% Recent 1.JPG"  As recently as November 2020 it would return the following:  Workplace TB 2020-11-08 Recent 1  However, I'm working on a different computer now, and the code instead returns  Workplace TB 6-19-20-1- Recent 1  The fact that the date no longer goes YYYY-MM-DD ins't that big of a deal. What's more concerning is the fact that '2021' shows up as '20-1-' instead. I'm not fluent in batch file or ANY code whatsoever, but I'm still better than my coworkers. Is there any way that I can fix this?


Why are there 2 syllables in the word "naked"? Why is the second syllable pronounced "id" and is there only one pronunciation for this word?


Saw this just now at Meta.SO and here when writing a new post:    This bug doesn't show when editing an existing post instead.  Firefox 62 win64.


How can I access the "Open command window here" option in Windows without holding shift?

When you hold Shift while right-clicking a folder in Windows, the context menu includes the option to Open command window here.  Is there a registry tweak, or an extension/add-on, which frees you from the need to hold Shift for this operation?


I heard this question from a professor a couple years ago. I still think about it...     Does the sequence $(a_n)_{n\in \mathbb N}$ with $$a_n=\sqrt[n]{|\sin(n)|}$$ converges ( to $1$ ) ?   I believe this question is related to rational approximation.


Numerical evaluation of the value of a non-elementary function

Let f(x)= $\int e^{-x^2}dx$  Is there any way to calculate the value of f(z) for any real number z? For example f(1), f(2.3), f(-3), etc.?


When mixing 16 ounces of chocolate and 4 ounces of oil together and melting it how long will it last ? How should I store it ? Can it cause botulism ?


Why shouldn't INFORMATION_SCHEMA views be used to determine the schema of an object?

According to MS-DOCS about , the schema  have a warning note that says:     ** Important ** Do not use INFORMATION_SCHEMA views to determine the schema of an object. The only reliable way to find the schema of a   object is to query the sys.objects catalog view.   Why can't INFORMATION_SCHEMA views be used to determine the schema of an object?  Is this information erroneous?


Partial derivative of $v$ w.r.t. $x$ in Lagrangian dynamics

In Lagrangian dynamics, when using the Lagrangian thus:  $$ \frac{d}{dt}(\frac{\partial \mathcal{L} }{\partial \dot{q_j}})- \frac{\partial \mathcal{L} }{\partial q_j} = 0 $$  often we get terms such as the one below which result in zero:  example 1: $$ \frac{\partial \dot{q}}{\partial q} = 0 $$ example 2: $$ \frac{\partial q}{\partial \dot{q}} = 0 $$  I wasn't sure why but this is the closest I have come to reasoning it out:  $$ \frac{\partial \dot{q}}{\partial q} =  \frac{\partial \dot{q}}{\partial t}\frac{\partial t}{\partial q}  = 0 $$  because  $$ \frac{\partial t}{\partial q} = 0 $$  and similar for example 2. Is this correct?


How EM waves are produced by accelerating charged particles?

How the electro-magnetic waves are produced by the accelerating charged particle? Graphical explanations are most welcomed. Is the explanation given by the below mentioned article correct regarding the movement of electromagnetic waves?


Using \footnotemark / \footnotetext trick for \footnote in \caption removes footnote number

I had the issue of having two footnotes appear in \caption in a figure-environment.  Fortunately, this answer () provided a solution.  My code is as follows:  \begin{figure}   \begin{minipage}{\textwidth}   \includegraphics[width=0.5\textwidth]{ReportMenu}   \caption[The report submenu]{Each of the pre-defined reports appear as a menu item in the \textbf{Reporting} submenu.  Some installations have custom reports made special by Innovative for them, and only appears on installations that request it.  ``Report queue'' is the only item not a report,\footnotemark{} while ``Fleet statistics'' is a special report for fleet handling and only available for installations with the fleet module.  In this example, all available (at writing) custom reports appear, none of which have been translated into English as they are designed for Danish and Norwegian installations.  These custom reports will not appear on new installations.}   \footnotetext{Since iv2.9e, another item for report scheduling has appeared underneath the report queue and is also not a report.}   \label{fig:menu}   \end{minipage} \end{figure}   Which yields the following result:    You'll notice that while the 5 for the inline note appears (this is correct at this point in the document), it does not appear the footnote itself.  How do I make the number (re-)appear on the footnote itself without having to manually force it?  I have a feeling I have missed something obvious.


I'm using Windows 8 and have managed to lose the Desktop tile.  How do I put it back?


What is this yellow line with a dot at the end?

I think I have entered a sequence of commands as a mistake and now a yellow line appears in top of my selection. I don't know what it is for or how to enable/disable it.  I have tried closing the editor but it keeps appearing.


Prove that there doesn't exist any integer $x \ge 3$ such that $x^2-1$ is prime.

Prove that there doesn't exist integer $x \ge 3$ such that $x^2-1$ is prime.


Make AES CBC more secure by destroying each block?

Assume AES in CBC mode is used to encrypt an arbitrary file. The key and the IV are generated out of secure random data and are both different for each file and of proper length and strength. Then the key the IV are encrypted with RSA. Now the AES encrypted file will be transmitted via an insecure transport from the sender to the recipient. The RSA encrypted key and iv are also transmitted via an insecure transport. The recipient now decrypt the IV and key via it RSA private key and then decrypt the file with the key and IV. So far so good and pretty common. Assume further that authentication is not necessary and GCM mode is out of scope here.   The question is now: Does it add "more security" (or will it even be "less secure") to "destroy" the encrypted AES file by flipping a bit (or two) of each AES block and store information about the flips alongside with the key and IV in the RSA encrypted part (so that the recipient can decrypt properly)?  Background of the question is the idea that an attacker, who "sees" the AES encrypted file, needs maybe more time and computing power to run a brute force attack because even when he has the right key and IV the decryption would fail because the blocks are all invalid?  Or is this "security by obscurity", useless, even dangerous or just another kind of "self invented encryption" (which is typically a bad idea)?


How do I retrieve an HTML element's actual width and height?

Suppose that I have a <div> that I wish to center in the browser's display (viewport). To do so, I need to calculate the width and height of the <div> element.   What should I use? Please include information on browser compatibility.


Is there a way to reload a Notepad file from within the application?

I have an application that will be writing integers into a file, line-by-line, at a rate of every 5 seconds.      I would like to use an program other than Notepad.exe, where I can reload the text file while it's being written to  . This way, I can see the changes easily as they're happening, instead of closing/reopening the file.


How to collect the unique word and their frequency from 1 M files collection?

I'm just trying to handle this problem but juggling here and there.  import java.io.*; import java.util.*;  public class file{   public static void main(String[] args) throws Exception {      Scanner in = new Scanner(System.in);     Scanner sc=null;     int count=0,uwords=0;     File folder = new File("<folder path>");// The collection of files     File[] listOfFiles = folder.listFiles();     HashMap<String,Integer> words_fre = new HashMap<String,Integer>();      FileWriter fw = new FileWriter("abc.txt");     //ArrayList<String> words = new ArrayList<String>();  for (File file : listOfFiles) {      if (file.isFile()) {         //System.out.println(file.getName());      try{       sc=new Scanner(/*new BufferedReader(new File*/(file));        //sc.useDelimiter("\\W");          while(sc.hasNext()){         String s = sc.next().toString();                      s = s.replaceAll("\\<.*?>","");                       count++; // words count                         if(words_fre.containsKey(s))                             {                                  int a = words_fre.get(s);                                  words_fre.put(s,a+1);                                        }                        else {                             words_fre.put(s,1);                             uwords++; // unique words count                            }             }        Object[] key =   words_fre.keySet().toArray();              Arrays.sort(key);             for (int i = 0; i < key.length; i++) {             //System.out.println(key[i]+"= "+words_fre.get(key[i]));           fw.write(key[i]+" : "+words_fre.get(key[i]) +"\n");          }          }catch(IOException e)             {                   System.out.println(e);              }    }         }            /*System.out.println("Total Words = "+count);              System.out.println("Unique Words = "+words_fre.size());*/             fw.write("Total Words = "+count+"\n");             fw.write("Unique Words = "+words_fre.size());                    fw.close();  } }    So basically my output something like that   eg.-     : 3     16800 : 1     23-12-2010 : 1     7 : 1     6 : 2      8वीं : 2      अंशु : 1      अधिकतर : 2      अन्य : 1      अपने : 1      हो। : 1      ॥ : 1     : 3  I need also remove in bracket  first entry [: 3 ] and second last [ ||: 1 ] and last one [:3 ]


How to show that $a^ab^b+a^bb^a\leq 1$ for $a,b\in(0,1)$ with $a+b=1$.

A little while ago I came across this question on Yahoo! Answers and it had no replies. I have spent a while trying to figure this out as well, but I couldn't find an algebraic proof. The assumptions are $a+b=1$ and $a,b\in(0,1)$. We want to show that $a^ab^b+a^bb^a\leq 1$. Or equivalently that $a^a(1-a)^{1-a}+a^{1-a}(1-a)^a\leq 1\;\forall a\in(0,1)$.  I tried see if $a$ and $b$ are an upper bound for $a^ab^b$ and $a^bb^a$ respectively, for their sum would be $1$ by assumption. However, I was unable to do so. I managed to show the following, assuming without loss of generality that $b\leq a$ (i.e. $a\geq\frac{1}{2}$): $$\begin{aligned} a^ab^b&=a^{1-b}b^b\\ &=a\left(\frac{b}{a}\right)^b\\ &\leq a. \end{aligned}$$ However, applying this same trick to $a^bb^a$ does not yield the necessary inequality: $$\begin{aligned} a^bb^a&=a^bb^{1-b}\\ &=b\left(\frac{a}{b}\right)^b\\ &\geq b. \end{aligned}$$ Which means that the upperbound $a^bb^b\leq a$ is too weak. By similar means one can find the following bounds: $$b\leq a^ab^b\leq a,$$ $$b\leq a^bb^a\leq a.$$  Now define $f(a):=a^a(1-a)^{1-a}=a^ab^b$. One can show that the following holds for the derivative of $f$: $$f'(a)=f(a)\log\left(\frac{a}{1-a}\right).$$ Since $f(a)=\exp(a\log(a)+(1-a)\log(1-a))>0$, we have that $f'(a)=0\iff a=\frac{1}{2}$. Since $f'(a)>0$ for all $a>\frac{1}{2}$ we have that $f$ has a minimum at $a=\frac{1}{2}$. Also note that $\lim_{a\to 1}f(a)=1$, hence by symmetry $\frac{1}{2}\leq f(a)\leq 1$ for all $a\in(0,1)$.  We'll define $g(a):=a^{1-a}(1-a)^a=a^bb^a$. One finds that $$g'(a)=g(a)\left(\frac{1-2a}{a(1-a)}+\log\left(\frac{1-a}{a}\right)\right).$$ Now $g'(a)=0\iff\log\left(\frac{1-a}{a}\right)=\frac{2a-1}{a(1-a)}$. It's clear that $a=\frac{1}{2}$ is a solution. Note that $\frac{d}{dx}\log\left(\frac{1-a}{a}\right)=\frac{1}{a(a-1)}<0$. Since $\frac{2a-1}{a(1-a)}$ is increasing, $a=\frac{1}{2}$ is the only solution. As $\lim_{a\to 1}g(a)=0$, we have that this is a maximum. Hence $0\leq g(a)\leq\frac{1}{2}$ for all $a\in(0,1)$.  Combining these results with what we already had yields the following inequalities: $$\frac{1}{2}\leq a^ab^b\leq a,$$ $$b\leq a^bb^a\leq\frac{1}{2}.$$ This gives us $$b+\frac{1}{2}\leq a^ab^b+a^bb^a\leq a+\frac{1}{2}.$$ Which is still not all too helpful... So then I got another idea. I construct two parabolas $\phi,\psi$ both with their top at $\left(\frac{1}{2},\frac{1}{2}\right)$. One of them, $\phi$, through $(0,0)$ and $(1,0)$ and $\psi$ through $(0,1)$ and $(1,1)$. Then I'd show that $a^a(1-a)^{1-a}\leq\psi(a)$ and $a^{(1-a)}(1-a)^a\leq\phi$. Then, since $\phi(a)+\psi(a)=1\;\forall a$ the statement is proven. However, this created some difficulty that I am now stuck on. I'll first define $\phi$ and $\psi$: $$\phi:(0,1)\to\left(0,\frac{1}{2}\right]$$ $$x\mapsto-2x^2+2x$$ Then $\psi(x)=1-\phi(x)$. We have $$\begin{aligned} \phi(a)&\geq a^{1-a}(1-a)^a\\ \iff-2a^2+a&\geq a^{1-a}(1-a)^a\\ \iff2a&\geq\left(\frac{a}{1-a}\right)^{1-a}. \end{aligned}$$ I cannot figure out how to prove this inequality though; let alone the other one. Hence now I am stuck!  I'm hoping someone can help figure this out. I realize parts of what I've done may be superfluous, but this is just everything that I have tried put together.


Adding table of certain attributes to map layout?

I am using ArcMap 10.2 and I'm looking for a way to add  a table containing certain fields from select elements from a featureclass to my map. Ive tried the add table option from the attribute table, but it doesn't quite give what I want (the table must be editable to look a certain way).   Are there any options out there for 10.2 like arcpy.mapping.tableview or will upgrading to 10.3 so I can get access to the "graphic table element" function be best?


Prove that: $$\sum _{k=0}^{n}{{(-1)}^{k}\binom n k}=0$$  I tried with induction and failed.  A solution explain would be greatly appreciated.


What's the scope of the "using" declaration in C++?

I'm using the 'using' declaration in C++ to add std::string and std::vector to the local namespace (to save typing unnecessary 'std::'s).  using std::string; using std::vector;  class Foo { /*...*/ };   What is the scope on this declaration?  If I do this in a header, will it inject these 'using' declarations into every cpp file that includes the header?


How to prove the inequality $2\sqrt{n + 1} − 2 \le 1 +\frac 1 {\sqrt 2}+\frac 1 {\sqrt 3}+ \dots +\frac 1 {\sqrt n} \le 2\sqrt n − 1$?

Prove that for any positive integer $n$, $$2\sqrt{n + 1} − 2 \le 1 +\frac 1 {\sqrt 2}+\frac 1 {\sqrt 3}+ \dots +\frac 1 {\sqrt n} \le 2\sqrt n − 1$$ Progress I think Riemann sum should be used for the middle term. I got the limit as $n\to \infty$ of the function inside using Riemann sum but what I cannot get are the lower and upper bound.


Why is the algebraic closure of a finite field countable?

An algebraic closure of a field K is an algebraic extension of K that is algebraically closed. It is one of many closures in mathematics. But why is it a countable set?


2 players. Can I play the draw 2 after a draw 4 if it was the last card to the previous player?

If the first player has their last card as a draw 4 wild card and says uno out,can the next player ask for a color to possibly counter with a draw 2 of the corresponding color said by the first player?


Is there a way to remove all ignored files from a local git working tree?

Yesterday I spent several hours debugging a problem with my git repo that wasn't fixed by git reset HEAD --hard because the files causing the problem were ignored by .gitignore.  Is there a way to "flush" or "clean" a git repo of all files that are being ignored, so that only the files tracked by git are present?  I finally fixed my problem by deleting the repo and cloning it from github again, but in the future, I would like to immediately remove all potentially problematic files (those that are being ignored).


Kummer's test - Calculus, Apostol, 10.16 #15.

I want to prove the following:  Let $\{ a_n \}$ and $\{ b_n \}$ be two sequences with $a_n>0$ and $b_n>0$ for all $n \geq N$, and let $$c_n = b_n - \frac{a_{n+1}b_{n+1}}{a_n}$$  Then   If there exists $r>0$ such that $0<r\leq c_n \text{ ; } \forall n\geq N$ then $\displaystyle\sum a_n$ converges. If $c_n\leq0$ for $n\geq N$ and if $\displaystyle\sum \dfrac{1}{b_n}$ diverges, then so does $\displaystyle\sum a_n$.   So far I know how to use and prove Cauchy's, D'Alambert's and the integral criterion, so I'd like a hint on either using those or a new idea. The book suggests that for $1$, I show that  $$\sum\limits_{k = N}^n {{a_k} \leq  \frac{{{a_N}{b_N}}}{r}} $$  and for $2$, to prove that $\displaystyle\sum a_n$ dominates $\displaystyle\sum \dfrac{1}{b_n}$  I'd like to prove this with previous theory on series convergence (Cauchy's and/or D'Alambert's preferrably, comparison test) since it is what precedes the problem, and would appreaciate great HINTS rather than answers.   I can't seem to understand the inequalities. I mean, Cauchy's and D'Alambert's criteria reveal that the proof relies on the fact that a geometric series of with ratio $|r| < 1$ converges, but I can't understand the motivation in this proof.    Summing up the work.  For 1:  $$\eqalign{   & {b_N} = {c_N} + \frac{{{a_{N + 1}}}}{{{a_N}}}{b_{N + 1}}  \cr    & {b_N} = {c_N} + \frac{{{a_{N + 1}}}}{{{a_N}}}{c_{N + 1}} + \frac{{{a_{N + 2}}}}{{{a_N}}}{b_{N + 2}}  \cr    & {b_N} = {c_N} + \frac{{{a_{N + 1}}}}{{{a_N}}}{c_{N + 1}} + \frac{{{a_{N + 2}}}}{{{a_N}}}{c_{N + 2}} + \frac{{{a_{N + 3}}}}{{{a_N}}}{b_{N + 3}} \cr} $$  Induction over $n$ we get  $${b_N} = {c_N} + \frac{{{a_{N + 1}}}}{{{a_N}}}{c_{N + 1}} + \frac{{{a_{N + 2}}}}{{{a_N}}}{c_{N + 2}} +  \cdots  + \frac{{{a_{N + n}}}}{{{a_N}}}{c_{N + n}} + \frac{{{a_{N + n + 1}}}}{{{a_N}}}{b_{N + n + 1}}$$  So  $$\eqalign{   & {b_N} \geqslant r\left( {1 + \frac{{{a_{N + 1}}}}{{{a_N}}} + \frac{{{a_{N + 2}}}}{{{a_N}}} +  \cdots  + \frac{{{a_{N + n}}}}{{{a_N}}}} \right) + \frac{{{a_{N + n + 1}}}}{{{a_N}}}{b_{N + n + 1}}  \cr    & {b_N} > r\left( {1 + \frac{{{a_{N + 1}}}}{{{a_N}}} + \frac{{{a_{N + 2}}}}{{{a_N}}} +  \cdots  + \frac{{{a_{N + n}}}}{{{a_N}}}} \right)  \cr    & \frac{{{a_N}{b_N}}}{r} > {a_N} + {a_{N + 1}} + {a_{N + 2}} +  \cdots  + {a_{N + n}} = \sum\limits_{k = N}^n {{a_k}}  \cr} $$  As desired.


php readdir problem with japanese language file name

I have the following code  <?php if ($handle = opendir('C:/xampp/htdocs/movies')) {     while (false !== ($file = readdir($handle))) {         if ($file != "." && $file != "..") {             echo $file."<br />\n";         }     }     closedir($handle); } ?>   When it does have mb language such as japanese, it doesn't display properly instead it display like kyuukyoku Choujin R ?????~? rather then kyuukyoku Choujin R 究極超人あ～る  Anyway to make it display the correct name or make it still download-able by others?  Thanks for helping me :)


Access structure in Attributes Based Encryption

I thought that access structure and access tree are equivalent but I've read in a  (page 3) that there are at least three types of access structures :   AND gates Access tree LSSS generating matrix   I would like to know what is the difference between them, are they equivalent or some of them are more expressive (better to use) than others?  Thank you in advance.


I have already proved $ x < y => x^n < y^n $ I am currently trying to prove the converse statement, but I am getting nowhere. The textbook suggests trying to set up a contradiction, but I can't seem to succeed with this.


What will *actually* happen to an object moving through an event horizon?

On the internets, it's common to state that inhabitants of hypothetical spaceship falling on the black hole wouldn't notice anything special when they cross the event horizon, and the only effect of them approaching the black hole if it's large enough would be tidal forces as they would approach the singularity.  To my understanding (based on the concept of Hocking's radiation), event horizon boundary is smooth and has no probabilistic component - e.g. all points are either inside or outside the event horizon, so it's not possible for a material point to be inside with 20% probability. Real life particles may be "20% inside", but due to their own uncertainty, not because of event horizon having some "probabilistic transition area".  What puzzles me is why I haven't seen anything about the event horizon influence on the molecular/atomic forces. If we imagine something half-submerged into an event horizon, wouldn't it prevent all fundamental interactions, including gravity, between an "inside" and "outside" parts of the object? It may still let interaction bozons through the event horizon to the inside part, but "reply bozons" won't get through, and to the matter outside the event horizon it would seem that the inside part is no longer existing, as it's not replying.  Also, due to the event horizon being the almost perfect plane (discarding slight curvature), it will go across bonds between atoms, and it could possibly split the nucleus into two parts as well. If splitting light nuclei this way, what would cover the energy deficite? What would happen to quarks if the event horizon boundary goes across the hadron?  So, due to my assumptions, any real life body crossing the event horizon would immediately cause nuclear decay and turn into some sort of quark dust long before spaghetticiation would occur. This maybe could be proven by actually submerging anything into the black hole's event horizon and then pulling it back to see the smooth cut and an explosion.  While flying to the black hole seems to be unrealistic, at least this year, nuclear decay events maybe should be observable from the far away due to lots of natural events of things falling into black holes?  I guess, these nuclear events maybe should be observed? If they are not, what am I missing in my thinkings?


According to latest modern theory on subatomic particles, electrons and protons are further divided into quarks, having fractional charges.  My question is, why can't they exist independently?  and why don't they show up Millikan's experiment?


Difference between "saw you" and "have seen you"

What is the difference between the two statements?   I saw you recently I have seen you recently   Are both the statements correct? If correct, then why?  Explain the difference between specified timing and unspecified timing with examples.


Least common multiple for 3 or more numbers

How do you calculate the least common multiple of multiple numbers?  So far I've only been able to calculate it between two numbers. But have no idea how to expand it to calculate 3 or more numbers.  So far this is how I did it    LCM = num1 * num2 /  gcd ( num1 , num2 )   With gcd is the function to calculate the greatest common divisor for the numbers. Using euclidean algorithm  But I can't figure out how to calculate it for 3 or more numbers.


How do I change the root location for Bash in Windows 10?

I have just installed Bash for Windows 10 and it works good.  It keeps its files in C:\Users\{my user name}\AppData\Local\Lxss. The main problem is that it is located in the C:\ directory which has very few space. I want to move it to D:\, which has 1 TB of space.  Is it possible to change root folder for Bash in Windows 10?


I have an Android phone which is connected to a secured Wi-Fi hotspot.  How can I find out the password of the hotspot from the phone?


Traveling to UK for different reasons than I initially got the visa for

I applied for the visa to participate in a university students conference. But I had to cancel my travel plans because of a family emergency.  I wanted to know if I can still can use the multiple entry Visa I have, until it expires, to enter UK for a similar type of conference and business related travel reasons or if I have to apply again to enter UK for the different reason of travel other than I applied for initially.


How to recover data erased by Killdisk Active@?

I'm getting working experience as hardware tech guy meaning I have to repair and fix used computers daily. One of those tasks is formatting all the hard disks and we use Killdisk active@, at Work for erasing all the data.   I'm interested in security related things appealing for used computers, which ones someone else is gonna buy as "used", how safe is Killdisk @ Active Free version?  With fast Google search, I didn't find any method to recover data erased by Killdisk. Is there any?


I want to replace all occurrences of a particular, previously-determined (known) email address --- with another email address, inside a PHP file; no regex should be involved ; sed is the simplest way I know to do so. This worked (the email has been changed): sed -i 's/\$to = "example@example.com"/\$to = "example_1@example_1.com"/g' FILE  But I think it's generally wrong to do text processing with one liners especially if one finds them "too long", so I tried to break it to the following which doesn't work: sed -i \ ' \ -e s/ -e \$to = "example@example.com"/ -e \$to = "example_1@example_1.com"/ -e g ' \ FILE   sed: -e expression #1, char 8: unterminated address regex  How to break sed commands to nested parts when no regex and variable expansions are applied? (i.e. when no regex and variable expansions / special quoting rules are part of the operation)