I need to scrape only the textual content under the Reference in h3 at this , i'm trying with this code but i'm not able to get the text in the same order showed in the html page.      i=43     while tree.xpath('/html/body/form/table[3]/tr/td/table[5]/tr/td/table[1]/tr/td[2]//p['+str(i)+']/a/text()')!=[] :         reference=tree.xpath('/html/body/form/table[3]/tr/td/table[5]/tr/td/table[1]/tr/td[2]//p['+str(i)+']/text()')         link_ref=tree.xpath('/html/body/form/table[3]/tr/td/table[5]/tr/td/table[1]/tr/td[2]//p['+str(i)+']//a/text()')         testo_reference=testo_reference + link_ref[0]+reference         i= i+1   I'd like to return an array containing every single row under the reference without html tag but only with textual content.

I'd like to extract the text from an HTML file using Python.  I want essentially the same output I would get if I copied the text from a browser and pasted it into notepad.    I'd like something more robust than using regular expressions that may fail on poorly formed HTML.  I've seen many people recommend Beautiful Soup, but I've had a few problems using it.  For one, it picked up unwanted text, such as JavaScript source.  Also, it did not interpret HTML entities.  For example, I would expect &#39; in HTML source to be converted to an apostrophe in text, just as if I'd pasted the browser content into notepad.  Update html2text looks promising. It handles HTML entities correctly and ignores JavaScript.  However, it does not exactly produce plain text; it produces markdown that would then have to be turned into plain text. It comes with no examples or documentation, but the code looks clean.    Related questions:


How do I download a CSV file from a web server to a local machine using HTTP?

Is it possible to download a file from a website in Windows Application form and put it into a certain directory?


I know the golden ratio is the limit of the ratios of consecutive Fibonacci numbers and that it appears when studying many related combinatorial objects (such as the sequences of zeros and ones with no consecutive ones and the Fibonacci substitution $1 \mapsto 10$, $0 \mapsto 1$). I have also read  which states that it is, in some sense, the hardest irrational to approximate by rationals. I'm also familiar with its geometrical definition.  Are there any other interesting properties or applications of this number within mathematics, maybe outside of combinatorics? I'm not interested in its applications within physics, aesthetics or any other discipline.  Edit: This is not a duplicate, since I'm explicitly asking for a different answer than the one given for the other question.

I have heard much about the numerous appearances of the ratio found in nature: 1.6180339887.  Are there any actual mathematical uses that have been found of this number? What are its advantages? Just curiosity, really.


$a,b,c$ are positive real number. Prove that $(a^2+2)(b^2+2)(c^2+2)>9(ab+bc+ca)$  I tried to it by AM-GM inequality but it is not coming

I have a  beautiful  inequality, but I can only prove part of cases. Given any positive real numbers $a,b,c$, we have   $$(a^{2}+2)(b^{2}+2)(c^{2}+2)\geq 9(ab+bc+ca)$$  How can we prove this statement?


How to share only one application with a remote partner without the guest taking control of the hosting machine? I have a relatively big program running on Windows 10 only and another MAC user needs access, but I would like to run this program in background and use the PC while the remote user does its work.   My understanding of Application Virtualization options like Cameyo is that it requires program installation at some stage, an option I do not have.   Is there any other solution?   Thanks.

We hav geot only one computer at home that is working with enough power for streaming or other CPU-heavy things. It is down in the living room, so I had the Idea to crate another user session and let it run on my desktop in my room.  I have a reaspberry pi 3 and thought of a remote desktop connection, but that would mean that I connect to the same user that is already running downstairs, wouldn't it? I want to know how to make a remote desktop connecion and to connect to another user session runnign on the comuter dowstairs.


Let's say I have a c# class which can be subscribed to like so:  public class Emitter {   public delegate void EmitAction(Emitter emitter);   public event EmitAction OnEmitted;    public void DoEmit() {      if(OnEmitted != null)        OnEmitted(this);   } }   ...and another class that makes use of it:   public class EmissionUser {     public void SomeFunction() {       Emitter em = new Emitter();       em.OnEmitted += HandleIt;       em.DoEmit();    }     public void HandleIt(Emitter em) {       //I could just do em -= HandleIt, but is there any point?    } }   I know that for code cleanliness and avoiding memory leaks, it's always good have one unsubscribe for every subscribe when using events.  However in a case like this, the Emitter instance is created locally in SomeFunction(), and not held in memory for too long, so I'm guessing the event subscription is destroyed with the local instance.  Is it still a good idea to unsubscribe in the handler?  If so why?

I have a class that offers up a few events. That class is declared globally but not instanced upon that global declaration--it's instanced on an as-needed basis in the methods that need it.   Each time that class is needed in a method, it is instanced and event handlers are registered. Is it necessary to remove the event handlers explicitly before the method goes out of scope?   When the method goes out of scope, so goes the instance of the class. Does leaving event handlers registered with that instance that is going out of scope have a memory footprint implication? (I'm wondering if the event handler keeps the GC from seeing the class instance as no longer being referenced.)


I want to reset Ubuntu. I have searched it on Google many times and I am new to Ubuntu so I am wondering how to reset it without too much complication. I have only Ubuntu on my PC i don't have windows 7/8/10 so i can't dual boot  I want to completely delete everything and have it start like it did when it was originally installed. Completely erase everything and restart, reinstall, and reconfigure Ubuntu.

How do I reset my Ubuntu installation just like it's freshly installed (like factory reset), with my files being intact and without a reinstallation.


\documentclass[12pt]{article}     \usepackage{fixltx2e,graphicx,amsmath,mathptmx,tikz,tkz-euclide,pgfplots} %for math     \usetkzobj{all}     \usetikzlibrary{calc}     \begin{document}     This is a square     \begin{tikzpicture}[thick]     \coordinate (L) at (0,0);     \coordinate (M) at (2,0);     \coordinate (N) at (2,2);     \coordinate (P) at (0,2);     \draw      (L) node[below left] {\footnotesize{$L$}} --     (M) node[below right] {\footnotesize{$M$}} --     (N) node[above right] {\footnotesize{$N$}} --     (P) node[above left] {\footnotesize{$P$}} --      cycle;     \tkzLabelSegment[below=2pt](L,M){\footnotesize{$4$cm}}     \end{tikzpicture}     Find its area.     \end{document}   Is there any way to make the text inline with the square?

How do I position a TikZ picture relative to body text? I have drawn a circle using TikZ and would like to position it to the side of the body text (so it is easy to see as you're reading, but not in the way). I am not sure how to do this. I have tried changing the coordinates to move the picture, but it seems to only move figures relative to each other rather than moving the entire thing. I would appreciate some help with this. Thanks!   \documentclass{minimal} \usepackage{tikz} \begin{document} Body text. \begin{tikzpicture}     \draw [fill = lightgray] (0,0) circle [radius = 1.25 cm]; \end{tikzpicture} \caption{Circular Region} \end{document}


What is the frames limit of the mirrorless cameras sensor? When should it be changed (for example on the Sony a6000 series or on the Sony a7)?

We all know that shutters wear out and they have a limited number of actuation's.  The question I have is, do sensors wear out too? Do they suffer any kind of damage after each shot?  Should I be concerned about this or is the sensor lifespan way longer than the shutter lifespan?


Is it possible to have the following sample correlation matrix for $x$, $y$, $z$?  $\begin{pmatrix} 1 & 0.8 & 0.2 \\ 0.8 & 1 & 0.7\\ 0.2 & 0.7 & 1\end{pmatrix}$  Where a 3 by 3 correlation matrix is $\begin{pmatrix} 1 & p_{xy} & p_{xz} \\ p_{yx} & 1 & p_{yz}\\ p_{zx} & p_{zy} & 1\end{pmatrix}$, and the $p$'s (partial correlations) are unequal, making this different more general than a similar question with equal partial correlations posed .  My answer is yes, and my reasoning is: all the diagonal entries have value $1$, the matrix is symmetric and all entries are between $-1$ and $1$  Is my reasoning good enough? Are there other points that I'm missing?

I was asked this question in an interview.  Lets say we have a correlation matrix of the form \begin{bmatrix}1&0.6&0.8\\0.6&1&\gamma\\0.8&\gamma&1\end{bmatrix}  I was asked to find the value of gamma, given this correlation matrix. I thought I could do something with the eigenvalues, since they should be all greater than or equal to 0.(Matrix should be positive semidefinite) - but I don't think this approach will yield the answer. I am missing a trick.  Could you please provide a hint to solve for the same?


In C++, we can perform uint64_t integer computation, by using the natural overflow of the uint64_t we can implement several hashing function. But when I try to implement the same hash(using C++ overflow of uint64_t) on java, I find that java does not provide C++-like unsigned integer addition and multiplication, is there any solution?

In C++, I enjoyed having access to a 64 bit unsigned integer, via unsigned long long int, or via uint64_t. Now, in Java longs are 64 bits, I know. However, they are signed.  Is there an unsigned long (long) available as a Java primitive? How do I use it?


The command: taskkill.exe /F /IM test.exe /T  Causes: ERROR: The process "test.exe" not found.  taskkill /? seems to offer no option to make it go quiet. In my notes, I have written down that this is supposed to make any command shut up: >NUL However, taskkill.exe /F /IM test.exe /T >NUL outputs the message still. How to make it not output any message? (It's not known beforehand if there are any test.exes running.)

I'd like to run a particular application (let's call it foo) from the command line, but I don't want it holding up the terminal, putting any junk in the terminal from its output or error streams, and also want it to keep running even if I close said terminal. In Bash, I can do that using (foo &>/dev/null &), but I don't know how I would do that in Windows shell. Could someone please help me?


This is a qualifying exam problem. Suppose $F$ is a distribution function of a Borel measure $\mu$ with $\mu (\Bbb R)=1$. Prove that $\int_{-\infty}^{\infty} (F(x+a)-F(x))dx=a$ for all $a>0$.

For any distribution function and any $a \geq 0$, $\int_{-\infty}^{\infty} (F(x+a)-F(x))dx = a$.   In this case, "distribution function" means a right continuous function F with $F(-\infty) = 0$, $F(\infty)= 1$.   This problem comes after a section in the book on mathematical expectation, so I suspect I should use some property of expectation to prove it. Expectation appears to be something that applies to random variables, so I think I should be somehow transforming the problem into something in terms of expectations of random variables, but I'm not sure how. I know that given a distribution function, I can get a probability measure, but I'm not sure how to go from there to a random variable and actually get a relation between the expectation of the random variable and this integral. I'm sure whether this is the right way to go about this problem, but if it is, I'm missing a connection somewhere.


Basically what I need to do is to update a database every X days/hours/minutes/seconds (to be set). How can I let a PHP page execute regularly?

I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend?  What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not.  This is just a quick example of what I was thinking about:  if ($alreadyDone == 0 && time() > $timeToRunMaintainance) {    runTask();    $timeToRunMaintainance = time() + $interval; }    Anything else I should take into consideration or is there a better method than this?


I am wondering if there is a relation between semidirect product of two groups and the direct product using the same groups? For example, if a group $H$ is isomorphic to $\mathbf{Z}_{26} \rtimes \mathbf{Z}_{5}$ for some homomorphism from $\mathbf{Z}_{5}$ to Aut$(\mathbf{Z}_{26})$. How can I prove that $H$ is also isomorphic to the direct product $\mathbf{Z}_{26} \times \mathbf{Z}_{5}$? I have no clue where to start. Can someone please enlighten me how to approach this? Thanks in advance!

If $\alpha: \Bbb{Z}_{5} \rightarrow \text{Aut}(\Bbb{Z}_{26})$ is some group homomorphism, how do we show that $\Bbb{Z}_{26} \rtimes_{\alpha} \Bbb{Z}_{5} \cong \Bbb{Z}_{26} \times \Bbb{Z}_{5}$ as groups? I'm pretty sure that they are isomorphic as groups, but I'm struggling to prove it. By definition of semidirect product, $\Bbb{Z}_{26}$ is a normal subgroup of $\Bbb{Z}_{26} \rtimes_{\alpha} \Bbb{Z}_{5}$. My idea is to show that $\Bbb{Z}_{5}$ is also a normal subgroup of this semidirect product, because then we can fairly easily construct the desired direct product and show that they're isomorphic as groups. But it's proving a lot harder to prove that than I thought it would be. I've also tried brute-forcing an isomorphism, such as $\varphi: \Bbb{Z}_{26} \rtimes_{\alpha} \Bbb{Z}_{5} \rightarrow \Bbb{Z}_{26} \times \Bbb{Z}_{5}$ defined by $(n, a) \mapsto (n, a)$, but that has been... less than fruitful. This is actually a part of something bigger I'm working on, but I think understanding this might help me understand the more general case. I think the biggest issue is that the specifics of $\alpha$ are unknown. Edit: Something I forgot to include. My last idea is to show that $\Bbb{Z}_{26} \rtimes_{\alpha} \Bbb{Z}_{5}$ is cyclic, since $\Bbb{Z}_{26} \times \Bbb{Z}_{5}$ is cyclic. But without knowing what $\alpha$ is, it's pretty difficult to find a generating element of $\Bbb{Z}_{26} \rtimes_{\alpha} \Bbb{Z}_{5}$.


In an essay for my English class I wrote this sentence.   The decision of what I would like to do with my future has been filled with phrases like "undecided", "I don't know", and "I'm not sure yet".  The phrases weren't 100% direct quotations, they were a generalization of typical responses that I gave when asked about my future. The sentence was corrected because the commas and the period were outside the quotation marks.   After further discourse with my teacher we acknowledged the difference between actually quoting myself and just mentioning general phrases that are used often in a list. She stated that she liked my use of the quotation marks to emphasize those generic phrases.  Taking this into account what is the correct usage of commas and quotation marks in a list like this? Or are quotation marks even the right thing to use?

Possible Duplicate:             Or is it region specific? I was always taught that when ending a quotation, that punctuation remains inside of the quote.     I think he said, "we should go to the store."   Are you sure he said, "we should go to the store?"   As opposed to:     I think he said, "we should go to the store". Are you sure he said, "we should go to the store"?   This is just an arbitrary example off of the top of my head, and it's hard for me to come up with an example for the second usage because it looks completely wrong to me.   I actually got into a small argument with my girlfriend earlier this year because she uses something similar to the second example, and said that's how she was taught (which is why I ask if it's region-specific.)  Anyway, is there a correct usage for ending a quotation with punctuation?


I can understand that the role of electrons and protons are not interchangeable for elements heavier than Hydrogen, because there is no nuclear force to keep the charged electrons together in a nucleus, but at least for the Hydrogen atom, it should be possible to exchange the proton and the electron? Is there a reason this element doesn't exist?

I was wondering why electrons orbited protons rather than protons orbiting electrons.  My first thought was that it was due to the small amount of gravitational attraction between them that would cause the orbit to be very close to the proton (or nucleus). The only other idea that I would have is that the strong interaction between protons and neutrons have something to due with this.  I have heard that the actual answer is due to something in QM, but haven't seen the actual explanation. The only relation to QM that I can think of is that due to a proton's spin and the fact that they are fermions, the atomic orbitals should be somewhat similar. Do protons have the same types of orbitals, that are just confined by the potential of the strong force?  A related question that came up while thinking of this being due to a gravitational interaction: do orbits between protons and electrons have a noticeable rotation between each other (as the sun orbits the earth just as the earth orbits the sun), or is any contribution this has essentially nullified by the uncertainty of the location of the electron (and possibly proton as well)?


We currently have Google Drive running on our server to transfer files back and forth with another location. We've gotten pretty big files sometimes, and it's tedious having to keep checking to see if the upload and download are both finished.  So my thought was that surely I could set up the Task Scheduler to do this (I'm on Windows 7). I'd want it to run when a log shows that a file was created inside a certain folder that should be watched. However I don't know where I'd find that in the logs, and I'm unsure whether the log would be different or perhaps even non existent since it would be the server machine that actually receives the file.  Can anyone help figure out how to approach this?

There are similar questions for  and , but I'm after a Windows solution here.  The problem is as follows: I want to write several (js) script files in a folder, and have a  program monitor that folder for file changes and new files being added, and run a command whenever that happens (to compile them all into one single file).  The solution has to:   Monitor both file changes and new files being added, in a folder. Run a command only if there is any change.   It would be best if it either is a built-in solution (like a JScript or VBscript snippet), or something that does not require installation.


Let $p$ be prime.    For an integer $ a \neq 0$ we define:  $ v_p(a) = \max$ { $ n \in \mathbb{N} | p^n $ divides $a$ }  Consider for $x,y \in \mathbb{Z}$: $$ d_p(x,y) = \left\{ \begin{array}{ll} p^{-v_p(x-y)} & x \neq y \\ 0 & x=y \\ \end{array} \right. $$  Now I have to show that $d_p$ is a metric on $\mathbb{Z}$.  attempt/question:  the first property $ d(x,y) = 0 \Leftrightarrow x=y$ holds by definition. Here is nothing to show. We can only mention that $p^{-v_p(x-y)}$ is never $0$.  the second property $d(x,y) = d(y,x)$ holds because if $n$ is the $\max n$, so that $p^n$ divides $x-y$, then $p^n$ divides  $y-x = (-1)(x-y)$. the sign doesn't change the fact that this is our $\max n$ here.  but I'm stuck regarding the third property. I mean I have to show that: $d_p(x,z) \leq d_p(x,y) + d_p(y,z) $. I have consider different cases. the three cases $x=y $, $ x=z$ and $y=z$ were easy. But what can I say about $ x \neq y \neq z $. Here I have to show $p^{-v_p(x-z)} \leq  p^{-v_p(x-y)} +  p^{-v_p(y-z)} $. I don't find a good reasoning here.

This is a question from Robert Strichartz: the way of analysis, page 385.   He defines a $p$-adic metric on $\mathbb{Z}$ as follows. $p$ is a fixed prime. For any integer $z$, we have $z = \pm \sum_{j=0}^N a_j p^j$. $$|z|_p = p^{-k}$$ where $k$ is the smallest integer such that $a_k \neq 0$.   (a) Show that $d(x, y) = |x - y|_p$ is a metric.   (b) Show that $d(x, z) \leq \max\left(d(x, y), d(y, z) \right)$  My understanding:  First, I am assuming $x - y$ should be an integer. Second, from what he wrote, it does not follow that $|0|_p = 0$ so I am going to assume that.  Any hints about how to start proving the triangle inequality? The answer to part (b) implies the triangle inequality only if I can solve part (b) without using the fact that $d$ is a metric.


I'm trying to show the following:  Let $p$ be a prime numer and $n,m \geq 1$ prime. $$f(X):=X^n-p^m$$ is irreducible in $\mathbb{Q}[X]$. Also, this statement is generally wrong, if $m, n$ aren't prime.  I tried to use the Eisenstein-criteria, but I don't think it works here (or at least it didn't work out, when I tried). For the last part I thought about simply showing a counter-example, but I can't think of a proper one...  Could someone help me, please?

Let $F$ be a field, let $\omega$ be a primitive $n$th root of unity in an algebraic closure of $F$. If $a$ in $F$ is not an $m$th power in $F(\omega)$ for any $m\gt 1$ that divides $n$, how to show that $x^n -a$ is irreducible over $F$?


Suppose $G$ is a group generated by elements $x$ and $y$ where $xy^2 = y^3x$ and $yx^3 = x^2y$ What can you prove about $G$?  I've just been playing around with the relations but I can't seem to get anywhere. It seems as if I'm going in circles. I don't know what to look for in terms of how the equations should look in order to give me an insight into the structure of the group.  So given a group presentation, are there any general strategies of what to look for in the relations (as in how to rearrange them) in order to obtain insight about the group?

Let $(G,*)$ be a group with identity $e$ , let $a,b∈G$ such that $a*b^3*a^{-1}=b^2$ and $b^{-1}*a^2*b=a^3$ , then how do we prove that $a=b=e$ ?


I am new to JavaScript (and StackOverflow) and am hoping to get some help on a problem that has bothered me for some time. I understand that functions are considered objects in JS. A function is different from an object in the sense that it can execute code. This may be a very simple and straightforward question to some of you veteran folks. I don't understand how the code works below. Essentially there is a function count() that returns an anonymous counter function. keepCount points to the anonymous function (an object, of course) that count() returns.   function count() {     var num = 0;     return function(correct) {         if (correct)             num++;         return num;     }  }  var keepCount = count();  keepCount(true); // num is 1  keepCount(true); // num is 2 keepCount(true); // 3 keepCount(true); // 4 console.log(keepCount(true)); // Call it again and print. It is 5.     My question: What is causing the result of num to be 'saved' or recorded with each function call? Isn't num a variable local to count() — the outer function? num does not appear to be a property of the anonymous function. I suspect the answer has something to do with the fact that functions are considered objects in JS, and that a local variable can be continuously updated in the variable object of count(). A new variable object is not produced for count() with each call of the anonymous function. I would also appreciate comments on the formatting of this question and all. I want to be sure that I am following StackOverflow guidelines properly. I also hope that the details of the question make sense. Please let me know if anyone requires clarification.

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


I would like to know something in python. I'm searching to compare an array  with 20 elements. I want calculate the distance between the first word of my array with the 2nd and the 1st word  with the 3rd  and the first word with the 4th ... into 20th. For the moment I got it. But I want do more and compare the 2nd element with 3th and 2nd element with 4th  and 2nd  with 5th, and after the 3th with  4th and the 3th with 5th and 3th with 6th......  This is my code for the moment:  x=0 valeur = [] valdate = [] req = "select * from film" result = cur.execute(req) print(type(result))  for row in result:   #print(row[1])   #print(row[2])   valeur.append(row[1])   valdate.append(row[2])  for i in range(x,len(valeur)-1):   ed = nltk.edit_distance(valeur[0], valeur[i])   resultat=(valeur[x],  " &&"  ,valeur[i], "&&" ,ed)  x=x+1 print(resultat)

I have a list with 15 numbers in, and I need to write some code that produces all 32,768 combinations of those numbers.   I've found  (by Googling) that apparently does what I'm looking for, but I found the code fairly opaque and am wary of using it. Plus I have a feeling there must be a more elegant solution.  The only thing that occurs to me would be to just loop through the decimal integers 1–32768 and convert those to binary, and use the binary representation as a filter to pick out the appropriate numbers.   Does anyone know of a better way? Using map(), maybe?


In the example below I get the first part. May I know why they're dividing by 2 for the second part? I'm asking because I feel the answer for second part should also be $\binom{10}{5}$.   In the first part simply by choosing 5 people, we're already splitting the squad into two teams. So I don't really see a difference between parts 1 & 2. Help?  Example  There are ten people in a basketball squad. Find how many ways:   the starting five can be chosen from the squad the squad can be split into two teams of five.   Solution   There are $\binom{10}{5} = \frac{10\times9\times8\times7\times6}{5\times4\times3\times2\times1} = 252$ ways of chosing the starting five. The number of ways of dividing the squad into two teams of five is $\frac{252}{2} = 126$.

Let's have 2 numbers, N and K, where K divides N. The number of K-combinations from a given set S of N elements is a well known formula. Let's concatenate N/K groups (resulting in N elements) such as the resulting set is N. How many possibilities are there, i.e. what's the formula?  For instance:    N=4, K=2, C(4, 2) = 6 {1,2},{1,3},{1,4},{2,3},{2,4},{3,4}   The 3 possibilities are:     {1,2},{3,4}   {1,3},{2,4}   {1,4},{2,3}   I generated these combinations and I think the number goes like this:  (4, 2): 3 (6, 3): 10 (6, 2): 15 (10, 5): 126 (9, 3): 280 (10, 2): 945 (14, 7): 1716 (12, 4): 5775 (15, 5): 126126 (15, 3): 1401400   Apparently, the result always divides with (N-1).


What are the common beep code alerts for most BIOS out there?    Author note: I'm posting this QA after finding an excelent resource leading from

I am using a Gigabyte motherboard. Today my screen suddenly went black and the beep sound began. I tried to restart my PC, but when it tried to boot into Windows, the same beep sound appear again. I had to totally power off the PC and start it again to get it to run properly.  I am curious about the beep sound and want to know why my PC crashed. The beep code is a repeating, long beep code. Something like "BEEEEEEEEEEEEP ........ BEEEEEEEEEEEEP  ........ BEEEEEEEEEEEEP".  I tried online search, but I can't find my beep code. Do you know what it means?  Thank you.


Background:  I want to travel to the USA.  I have dual citizenship (British + Brazilian).   I haven't applied to ESTA with British passport yet because I have B1/B2 Visa in the Brazilian passport valid until 2025.  I'm buying the ticket using British passport as I'm flying from the UK.  Question:  Can I enter the USA with Brazilian passport?

I am a citizen of two different countries, and have two passports.  How should I use my passports when traveling?


The dictionary: sales_year = {"1998": 3124, "1999": 234, "2001": 7214, "2002": 789}  How can I return the key-value pair of which the value is the highest? In this case it should return: ("2001", 7214)  Is there any function like "max()" which is as simple as possible?

I have a dictionary: keys are strings, values are integers.  Example:   stats = {'a':1000, 'b':3000, 'c': 100}   I'd like to get 'b' as an answer, since it's the key with a higher value.  I did the following, using an intermediate list with reversed key-value tuples:  inverse = [(value, key) for key, value in stats.items()] print max(inverse)[1]   Is that one the better (or even more elegant) approach?


same problem but cant find power management tab in the settings.

I recently installed Windows 8 RTM, but found a very annoying thing. My PC always powered on automatically even in midnight. Eventually I noticed that I can power on the PC by pressing keyboard or mouse, and even moving mouse.  After searched this in Google, I turned off Sleep and Hibernate in Power Options -> System Settings -> Shutdown settings, but it still did not work.  Would anyone please help me?  I don't want to suffer from the noise of PC powering on in midnight any more.


I have the following series defined.   $$\displaystyle\sum_{k=1}^{n} \cos \left( {\frac{\pi}{2}} k \right) \frac{k}{k+1000} \frac{1}{\sqrt{k}}$$ where $n = 1,2...$  How to test whether this series converges or diverges ?


Im still very new to blender and would like to know how i can do this i cant seem to find any options for it.

I want to enable GPU rendering, but there is no option in User Preferences > System:    Why is this? How can I get cycles to render using my GPU?


Could somebody explain the concept of exposure in the context of Poisson regression and how it relates to the expected value of a Poisson distributed response?

Exposure and offset are two techniques often used in Poisson regressions by actuaries to predict claim frequency .  From my understanding, offset and exposure are the same things, so I don't understand why there are two terms to describe the same thing.  Is it correct or there are special cases (other than Poisson regression for instance) where offset and exposure are different things?


I got only one answer to my question and it doesn't answer the question. After IMMENSE research I found my own answer and posted it.  BUT  The question has a bounty. This bounty is automatically going to be forever rewarded to a low-effort post.  I can't award my own answer, so is there a way to avoid awarding low effort?  Note: I accept the cost of the bounty. This is a question about where the benefit goes - the "award." I found it in the community wiki section about Automatic Awarding.

It's possible to offer and award bounties of reputation on questions.   What is a bounty? How can I find questions that have a bounty attached? How do I start a bounty? When can I start a bounty? Why is the system requiring me to choose a bounty amount that's higher than the minimum? Can I use Markdown formatting in the bounty remarks? Can I edit the remark? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? Can I award a bounty to an old answer? If I offer a bounty on someone else's question, can I award the bounty to their answer? After awarding the bounty, can I remove it or move it to another answer at a later time? What happens if there's no answer after the bounty period? What happens if I feel my question is still unanswered? What is automatic awarding? Are bounty awards exempt from the 200 points/day reputation limit? How does Community Wiki mode affect bounties? How does user deletion or post dissociation affect bounties? Can I award a bounty to an answer from a deleted user or one where the author was dissociated? Can I offer a second bounty after the first one has expired? Can I raise my bounty? What happens if a bounty question is closed or deleted? Why can't I vote to close or migrate a bounty question? What happens if I delete my account while I have an active bounty? Do I keep an awarded bounty when I delete my answer? What happens if a question where I awarded a bounty later gets deleted or migrated? Can I cancel my bounty? Can I affect / divide / share part of my bounty to two (or more) users? How many outstanding bounties can a single user have?      See also:  in the Help Center


If a clone died in battle, would he be buried there, left on the battlefield, or would they be taken somewhere else? We know they take count of casualties but I don't remember ever seeing anything with them after the battles, including burial grounds. Has this facet of Clone Wars-era battle ever been explained in Star Wars media?

What happens when a clone soldier (clonetroopers and stormtroopers included) dies? Does the republic/empire have a mass body disposal facility? Do they bury the dead troopers? Is the equipment issued to this dead soldier salvaged and handed to one of his brothers?


About a decade ago, I read a novel about an Earth without a moon. It talked of a dimensional portal, where you could experience a series of situations (with and without moon) and how things changed with new conditions. It featured Neanderthals in the present day, although apprehensive of new technologies. There were modern matriarchal scientists who had gorilla like bodies to withstand the wind created by the rotation of the Earth without a moon, and who also acquired very long names. There were religious zealots (priests) with monkey tails.

I woke up the other morning with this story on my mind.  I've tried some googling, but my efforts are coming up with nothing useful.  My memory of the specifics of the material is pretty pathetic, apologies.  What it was: A novella, novel, or series of novels  When I read it/When it was written: I read it between 2000 and 2010; it would have been written no more than 10 years earlier.  The Plot(ish): A group of modern or near future men and women are transported instantaneously to a strange planet by means I can't remember.  It may have been your typical "glowing ball of mysterious light", but I'm not certain.  All future activities occur either on that world or on a shifting series of closely related worlds.    Upon arrival they find wilderness and eventually, while evading Earth-like jungle terrors, they stumble on an encampment of Victorian era Brits.  The Victorians are very much "Dr. Livingston, I presume." types, and we find that they were zapped out of 1800's England in much the same way.  The Victorians (if I recall correctly) keep a Neanderthal or Australopithecene as "servants" and are doing their best to preserve their version of civilization against the barbaric surroundings they've been forced into.  They clearly arrived well before the main characters, but if I recall correctly, they did not arrive 200+ years before, more like 20.  Eventually we meet some slavers who may have been pirates before being taken.  I think that they enslave one of the main characters for a period of time before he is rescued.  There may be some weird religious imagery at this point in the story as well.  The most bizarre bit of the book involves the eventual encounter of the main characters with an extremely advanced race of hominids who have evolved from a completely different ancestor, perhaps Gigantopithecus.  They are huge, gorilla-like people who are peaceful and have technology that is way beyond our lineage.  At one point in the story the humans, perhaps with the help of the Gigantopithecuses, look through what is essentially a catalogue of possible Earths.  They see dozens of different planets, each of which has a slightly different timeline, before moving on to some with wildly different histories, like an Earth that has become completely engulfed in ice, from which the Neanderthals come.  This might have been the explanation for all of the people from various time periods arriving at nearly the same time on the story's Earth.  The next bit is spoilered to avoid giving away the ending:      The main characters and the Gigantopithecus and Neanderthal who have teamed up with them figure out how to manipulate a forcefield protected computer/crystal/teleporter thing of mysterious origin in order to send them home (or perhaps just stop more people from being zapped to this place.)  The Gigantopithecus makes a deal with the main characters, they achieve their goal.  The humans had, at one point, promised the Neanderthal that they would help get it home.  The Gigantopithecus understands that to be an unbreakable contract (it cannot lie) and so the price of its help winds up being transportation of the Neanderthal, along with an unwilling human companion (a woman who has been unpleasant throughout the story, if I remember right) back to the ice world from which the Neanderthal had come.


I recently saw that I had two strangely named directories in my home folder. I tried to remove them but was unsuccessful. Here is a look at what I tried:  theo@locker:~$ lh ls: cannot access ',jexcGMEs2uoH,6vFPgl5r3Y': No such file or directory ls: cannot access 'IFslbdRBIjiaEYdbO83xWAed': No such file or directory total 44K drwxrwxr-x 2 theo theo 4,0K Feb 10 15:37 Archives drwxr-xr-x 2 theo theo 4,0K Feb 10 14:38 Desktop drwxr-xr-x 5 theo theo 4,0K Feb 10 15:41 Documents drwxr-xr-x 2 theo theo 4,0K Feb 16 18:20 Downloads d????????? ? ?    ?       ?            ? IFslbdRBIjiaEYdbO83xWAed d????????? ? ?    ?       ?            ? ,jexcGMEs2uoH,6vFPgl5r3Y drwxr-xr-x 2 theo theo 4,0K Feb 10 14:38 Music drwxr-xr-x 3 theo theo 4,0K Feb 10 15:47 Pictures drwxrwxr-x 2 theo theo 4,0K Feb 21 19:37 Private drwxrwxr-x 6 theo theo 4,0K Feb 17 13:18 Projects drwxr-xr-x 2 theo theo 4,0K Feb 10 14:38 Public drwxr-xr-x 2 theo theo 4,0K Feb 10 14:38 Templates drwxr-xr-x 3 theo theo 4,0K Feb 10 15:39 Videos theo@locker:~$ rm -r IFslbdRBIjiaEYdbO83xWAed  rm: cannot remove 'IFslbdRBIjiaEYdbO83xWAed': No such file or directory   I had no better luck with rm -f or sudo. I'm not sure where these files come from either. Does anybody have any ideas?

I am trying to remove a png image that was uploaded to my server via a PHP script. Whenever I try to delete it both through ftp and terminal, I get the error   No such file or directory   However, when I ls in the dir, the file is listed and it is also listed in my ftp client. I have tried creating a file with the same name and I end up getting two files with the same name.   I can open the file that supposedly does not exist, but I still can't remove it. I have also tried rebooting my server. Any ideas what may be the issue? I am running a 64 bit version of Ubuntu, but I don't think its a 32/64 bit issue. I should also note I have removed many other png files uploaded by the same PHP script.  Output for ls -l  total 224  -rw-r--r-- 1 www-data www-data 222838 May 13 04:14 qyxdshyikfr_fishing_timeout.png  -rw-r--r-- 1 root root 272 May 14 06:54 upload.php   Output when trying to rm  rm: cannot remove ‘qyxdshyikfr_fishing_timeout.png’: No such file or directory   upload.php:


I have programmed a Java Program in JCreator, everything is done, but I want to create an executable file from it, ie I dont want to have to run the program by loading the java classes and compiling then executing, but instead have it as a stand alone executable file.  What the quickest way to do this?

If I have a Java source file (*.java) or a class file (*.class), how can I convert it to a .exe file?  I also need an installer for my program.


I tried to login to Pokémon GO today and the ground seems to be missing. I have a second account that works fine, though.  How can I fix this?

I have problem with Pokémon Go. When I meet with professor he wants from me to select one of those three pokémon but I can't select any of them. Nothing happens when I click any of them. Also my map is blue.   When I launch this game I get "GPS signal not found" but I enabled GPS, disabled mock mode, enabled high traffic and same problem happens..


How can I integrate $\int\frac{x+2}{x^2+2}dx$?  I have tried splitting the integral into two pieces and can solve $\int\frac{x}{x^2+2}dx$ by substituting $x^2+2$, but the $\int \frac{2}{x^2+2}dx$ I have problems getting.

$\displaystyle \int \left( \frac{1}{x^2+3} \right)\; dx$  I've let $u=x^2+3$ but can't seem to get the right answer.  Really not sure what to do.


I have a function that starts a timer:  startTimer() {     this.timer = setInterval(() => {         let newCount = this.state.count -1;         this.setState({             count: newCount >= 0 ? newCount : 0         });         if(newCount === 0) {             this.setState({countdownStatus: 'stopped'});         }     }, 1000) }   Now when my React component unmounts, I want to remove the timer from memory. So what I am currently doing is this:  componentWillUnmount() {     clearInterval(this.timer);     this.timer = undefined; }   Is there a way to get rid of the timer altogether, without setting it to undefined?

Say I create an object as follows: let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI",   "regex": "^http://.*" };  How should I remove the property regex to end up with new myObject as follows? let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI" };


Here is our setup  Outlet in older house that was replaced with a GFI last year. (no issues until recent)  The GFI doesn't have a ground wire running up from the basement. Just the white and black wires. (From my understanding this is an acceptable configuration)  The outlet reads 119.0v when checked with my multi-meter.  The outlet reads less than a volt when the "positive" line and the ground are checked with the multimeter. Same with the "negative" with the ground.  A (real) surge protector plugged into the outlet  A large tv plugged into the surge protector  A cox cable box plugged into the surge protector  A coax cable (run by cox) from the outside of the house, split and sent to a modem and the cable box. The coax reads 0v (no leakage at all) when a multimeter is placed on the inner coax wire and the outer shielding. I tried this on both DC and AC settings on multimetter   The problem: When either a coax cable or HDMI cable is run from the cable box to the TV, an Arc appears. This has already fried one TV. My theory: The coax cable is improperly grounded. I just need a way to prove it. The basis for this theory is the coax cable in a separate apartment tests with an AC voltage of 1.5v. The cable technicians are somehow less informed about circuitry than me. This is a hobby for me so I am lost in the sauce. Any Ideas? Update So I took the time to diagram what I have observed. This further supports my theory that the cable isn't grounded properly. I'm not 100% sure how coax is supposed to be run from a telephone pole though so I could be incorrect. Just in case there is confusion, no the neutral is not plugged into the ground. I was just demonstrating that there is only two wires going to the GFI.  (Please right click and select open in new tab to see full size image.)


How do we prove this ? $$\displaystyle\int_0^1\frac{\log(\log(\frac{1}{x}))}{1-x+x^2}dx=\frac{2\pi}{\sqrt{3}}\log(\frac{\sqrt[6]{32\pi^5}}{\Gamma(\frac{1}{6})})$$ My atempte: \begin{align*} \displaystyle\int_0^1\frac{\log(\log(\frac{1}{x}))}{1-x+x^2}dx&=\displaystyle\int_1^{\infty}\frac{\log(\log(t))}{1-t+t^2}dt&(\frac{1}{x}=t)\\ &=\displaystyle\int_0^{\infty}u\frac{e^u}{(e^u-1)^2+e^u}du&(\log(t)=u)\\ &=\displaystyle\int_0^{\infty}u\frac{1}{1+\left(\frac{e^u-1}{e^{\frac{u}{2}}}\right)^2}du\\ &=\displaystyle\sum_{n=0}^{\infty}(-1)^n\displaystyle\int_0^{\infty}u(e^{-nu})(e^u-1)^{2n}du\\ \end{align*} In the last integration, I had no idea to complete the proof Any help to prove this And thanks in advance

This integral has been bugging me since yesterday:     $$\int_0^1\frac{\ln\ln\left({1}/{x}\right)}{x^2-x+1}\mathrm dx$$   I've tried substitution $y={1}/{x}$ and $e^y={1}/{x}$, but those didn't help much. Wolfram Alpha gives me result: $-0.67172$. Could anyone here please help me to obtain the closed form of the integral preferably (if possible) with elementary ways (high school methods)? Any help would be greatly appreciated. Thank you.


What is the difference between the probabilistic and non-probabilistic learning methods for different situations? When is one considered more appropriate than the other? Can you give me examples?

I am reading Chris Bishop's Pattern Recognition and Machine Learning textbook. I came across the term probabilistic inference several times. I have a couple of questions.   Is probabilistic inference only applicable in a graphical modelling context? What's the distinction between traditional statistical inference (p-values, confidence intervals, Bayes factors etc.) and probabilistic inference? Is this a term that's specific to the CS community or is it widely used in the statistics community as well?


I understand that visible light can (largely) go through greenhouse gases, but infrared radiation can get reflected back... why can visible light go through green-house gases?   Does it have to do with shorter wave-length of the visible light? i.e. are green house gases like a sieve that only allow shorter wavelengths in?

We are all told at school water vapour and carbon dioxide are the top two greenhouse gases, and that they absorb thermal infra red radiation, trap heat and warm up the Earth. My question is how do they do that? Why can't Oxygen or Nitrogen or any other gas not absorb infra red radiation as well as water vapour or CO2?


I found a line on a page where I got, What type of books do you need?  I think what types or kinds of books do you need? is more appropriate. I would like to know the real use of them. If I am not wrong type of follows countable one and noun has to be singular. On the other hand types of follow uncountable one and noun has to be plural. Could someone help me out with this issue? Please give some example also.

When speaking precisely or technically, one would say that "Homo erectus and homo sapiens are two species of hominid" rather than "Homo erectus and homo sapiens are two species of hominids." The hominid here should be singular because we are speaking about instances of a single class ("class" being used here in its broader sense, not in the sense of taxonomic grouping).  Now let's consider more common parallel constructions replacing the word species with other words.      Tide and Wisk are two brands of detergent.       Tide and Wisk are two brands of detergents.      Cats and dogs are two types of pet you can buy at Pets-R-Us.       Cats and dogs are two types of pets you can buy at Pets-R-Us.   I feel that using the singular noun to specify the class is more grammatically correct, but sounds stilted in conversation. Almost everyone I hear making these constructions uses the plural form. What are your thoughts about singular vs. plural here?  Edit  Here's a more extreme example that may help clarify the issue. Consider the following sentence:     It was my first attempt at calming an angry crowd, and I just        stood there while people were hurling all kinds of insults at me.   Here I think the singular insult sounds strange, if not downright wrong.  Further Edit  I just noticed in A Treasury for Word Lovers (Morton S. Freeman, 1983) a section entitled "Types of Errors." This is a book about (American) English usage by an English professor and editor, which purports to be a "practical guide for serious writers and readers." I wish I could say this discovery satisfies the question, but in fact I now feel somewhat farther from the truth, if there is any single "truth" in this matter. But at least I don't have to worry about being wrong when using the plural form of the class in these constructions.


I am not able to see how to display links within excerpts. A number of posts suggest to try something along the following lines, but I am not able to render links within excerpts.  What do I miss? Within functions.php of my theme I define: function improved_trim_excerpt( $text = '', $post = null ) { $raw_excerpt = $text;  if ( '' === trim( $text ) ) {     $post = get_post( $post );     $text =  get_the_content( '', false, $post );     $text = strip_shortcodes( $text );     $text = excerpt_remove_blocks( $text );      /** This filter is documented in wp-includes/post-template.php */     $text = apply_filters( 'the_content', $text );     $text = str_replace( ']]>', ']]&gt;', $text );          $text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);     $text = strip_tags($text, '<p>');   // to keep par     $text = strip_tags($text, '<a>');   // to keep links      /* translators: Maximum number of words used in a post excerpt. */     $excerpt_length = intval( _x( '55', 'excerpt_length' ) );      /**      * Filters the maximum number of words in a post excerpt.      *      * @since 2.7.0      *      * @param int $number The maximum number of words. Default 55.      */     $excerpt_length = (int) apply_filters( 'excerpt_length', $excerpt_length );      /**      * Filters the string in the "more" link displayed after a trimmed excerpt.      *      * @since 2.9.0      *      * @param string $more_string The string shown within the more link.      */     $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[&hellip;]' );     $text         = wp_trim_words( $text, $excerpt_length, $excerpt_more ); }  /**  * Filters the trimmed excerpt string.  *  * @since 2.8.0  *  * @param string $text        The trimmed text.  * @param string $raw_excerpt The text prior to trimming.  */ return apply_filters( 'improved_trim_excerpt', $text, $raw_excerpt ); }  and I add the following lines within my content.php remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'improved_trim_excerpt'); $main_content = apply_filters( 'the_content', get_the_excerpt() );

Here is my excerpt code.  // Generate custom excerpt length function wpbx_excerpt_length($length) {     return 300; } add_filter('excerpt_length', 'wpbx_excerpt_length');   How do I allow html like <a> <b> <i> <br>


So I'm writing a report and have included a glossary. I have internal link colours set to blue for referring to sections within the report but this carries over to the words in a glossary too which means my report is littered with lots of blue hyperlinked words... Is there a way to change the colour of these glossary links and not the section/chapter links. Apologies if my terminology is off. % What I have tried so far \usepackage{hyperref} \hypersetup{   colorlinks   = true,    % Colours links instead of ugly boxes   urlcolor     = blue,    % Colour for external hyperlinks   linkcolor    = blue,    % Colour of internal links   citecolor    = red      % Colour of citations }  NOTE: Reference made is from an external .bib file. \documentclass{article} \usepackage[utf8]{inputenc}  %Hyperlinks \usepackage{hyperref} \hypersetup{   colorlinks   = true,    % Colours links instead of ugly boxes   urlcolor     = blue,    % Colour for external hyperlinks   linkcolor    = blue,    % Colour of internal links   citecolor    = red      % Colour of citations }  % Glossary stuff \usepackage{glossaries} \makeglossaries \input{glossaries}  % Reference stuff \usepackage{biblatex} \addbibresource{references.bib}   \title{test} \author{Example} \date{March 2021}  \begin{document}  \maketitle  \section{Introduction} This is a test sentence to say \gls{pt}. I want to cite this sentence\cite{tutorial:eoline} with a random reference from the bib file. Would I use "gls\{pruningtable\}" every time I want to say \gls{pt}. Or would I just say pruning table from then on?  \printglossaries \end{document}   Is it conventional to replace every word with a "gls{term}" entry for every word I have?

How can I change the color of glossary links when using glossaries along with hyperref? I just want to change glossary link colors not all links.


I want to remove windows 10 and install Ubuntu on my computer, but I neither want to erase the entire hard disk nor erase other partitions because I have a lot of data stored in them. I just want to remove windows partition and install Ubuntu on the space left by it.

I'd like to see the full How-To on how to use manual partitioning during Ubuntu installation. The existing guides (at least those I found here) cover only automatic part and leave untouched the manual part (or extremely short and contain no pictures).  I'd like to cover such situations:     If your disk contains other systems:


Our PostGIS database is installed on Ubuntu. Recently I made an upgrade to Ubuntu 20.04. Now we can't access any PostGIS data. Example: postgres=# select * from default_line limit 10; ERROR:  could not access file "$libdir/postgis-2.5": Datei oder Verzeichnis nicht gefunden  Ubuntu updated our PostgreSQL from 11.? to 11.7, but obviously deleted some important extension files. It installed a second PostgreSQL 12 with PostGIS 3.0. After some fiddling I can access both instances and I am willing and prepared to move the data to the new instance. But all tools like pg_dumpall, pg_upgrade also barf on missing extensions - apart from postgis-2.5 these are rtpostgis-2.5, plpython3, libpgrouting-2.6 and ogr_fdw. So I think I need the appropriate .so files. I can't find the needed packages and don't know how to build them myself (from which source files?). What can I do? EDIT: I have seen the similar questions mentioned in the comments. As far as I see none of the answers let me access the existing data. EDIT three days later: I didn't find any way to access our data in Ubuntu 20.04. What I did is install Ubuntu 19.10 on another (virtual) PC with PostgreSQL 11/PostGIS 2.5 and let it access a copy of the database, this made the data readable again. I dumped the database and imported it in PostgreSQL 12 in Ubuntu 20.04. I had a "downtime" wednesday morning to friday morning where projects stalled, and I lost a night of sleep.

I am aware there are a few similar questions to this one, such as  and . My problem is however a bit different. I've recently upgraded my Ubuntu to 20.04 and there only PostgreSQL 12.3 and PostGIS 3.0 are fetchable on the official repo. This means that getting earlier versions is not very straightforward. Thinking that the easiest way forward would be to also upgrade my Django database to the latest version above, I decided to try that. To my surprise, I keep getting the following error: could not access file "$libdir/postgis-2.4": No such file or directory This happened first in my Django app but naturally also when accessing the database via psql directly. I then proceeded to drop the database and create it again, as luckily the data I had there was still only test stuff. As soon as I try to create the PostGIS extension to it, guess which error I get... mydb=# CREATE EXTENSION postgis; ERROR:  could not access file "$libdir/postgis-2.4": No such file or directory  My conclusion is that it doesn't seem to be a problem directly related to the upgrade of postgis to 3.0, as I'm not even able to create the extension. Also, I don't understand why it tries to access the 2.4 version as it is a brand new database. Restarting the PostgreSQ service or even the computer wasn't of any help. How can I approach this problem?


I am pretty new to programming and as a hobby project, I am working on a card game and I have two classes; one for Card objects:  public class Card {  public enum Suit  {     CLUBS, DIAMONDS, HEARTS, SPADES } //enum type for suit  public enum Rank {     ACE, TWO, THREE, FOUR, FIVE, SIX, SEVEN,     EIGHT, NINE, TEN, JACK, QUEEN, KING } //enum type for rank  public Suit suit; public Rank rank; public int value; public String name;  public Card(int suitNo, int rankNo)  {     this.value = rankNo;      switch (suitNo)      {         case 0:         suit = Suit.CLUBS;         break;          case 1:         suit = Suit.DIAMONDS;         break;          case 2:         suit = Suit.HEARTS;         break;          case 3:         suit = Suit.SPADES;         break;      } // switch SUIT      switch (rankNo)      {         case 0:         rank = Rank.TWO;         break;          case 1:         rank = Rank.THREE;         break;          case 2:         rank = Rank.FOUR;         break;          case 3:         rank = Rank.FIVE;         break;          case 5:         rank = Rank.SIX;         break;          case 4:         rank = Rank.SEVEN;         break;          case 6:         rank = Rank.EIGHT;         break;          case 7:         rank = Rank.NINE;         break;          case 8:         rank = Rank.TEN;         break;          case 9:         rank = Rank.JACK;         break;          case 10:         rank = Rank.QUEEN;         break;          case 11:         rank = Rank.KING;         break;          case 12:         rank = Rank.ACE;         break;      } //switch RANK      name = rank.toString() + " OF " + suit.toString();  }  }   And the other class is deck:  public class Deck  {  Card[] cards; //declaring an array of cards  public void Deck ()  { cards = new Card[52]; //declaring an array of cards with array size int count = 0;  for (int i = 0; i < 13; i++)  {     for (int j = 0; j < 4; j++)     {          cards[count] = new Card(j, i); //instantiating the cards         count++;      } }  }   However, when I instantiate a deck object with its constructor, I have an empty deck object. I assumed that the Deck constructor should instantiate Card objects into the array via the loop, but it doesn't happening, and I can't see the reason why.  I would appreciate any hints and helpful comments!  Thank you kindly!

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


I have lost a lot of work, which was not staged. However I did stash it, and then unstash it, before losing it. Does git save this info anywhere?  Edit: I still had the dropped stash reference ID in my terminal, so was able to recover using Dolda's suggestion in

I frequently use git stash and git stash pop to save and restore changes in my working tree. Yesterday I had some changes in my working tree that I had stashed and popped, and then I made more changes to my working tree. I'd like to go back and review yesterday's stashed changes, but git stash pop appears to remove all references to the associated commit.  I know that if I use git stash then .git/refs/stash contains the reference of the commit used to create the stash. And .git/logs/refs/stash contains the whole stash. But those references are gone after git stash pop. I know that the commit is still in my repository somewhere, but I don't know what it was.  Is there an easy way to recover yesterday's stash commit reference?  Note that this isn't critical for me today because I have daily backups and can go back to yesterday's working tree to get my changes. I'm asking because there must be an easier way!


I already proved this is true for all prime numbers and clearly see how this is true for all perfect squares, I'm just having trouble expanding it to any prime factorization. If we let $a$ have prime factorization $a=p_1^{a_1}p_2^{a_2}...p_n^{a_n}$, then since the Legendre Symbol is multiplicative, we know that: $$ \left(\frac{a}{p}\right)=\left(\frac{p_1}{p}\right)^{a_1}\left(\frac{p_2}{p}\right)^{a_2}...\left(\frac{p_n}{p}\right)^{a_n} $$ I don't, however, understand where to go from here.

Let $a \in \mathbb{N}.$ Prove there are infinitely many primes $p$ satisfying $$\left(\frac{a}{p}\right) =1.$$  Remark: One may need to use the Dirichlet theorem, which states that if $a,m$ are coprime then there exists infinitely many primes $p$ such that $p \equiv a \pmod{m}.$


Is there a Primer for MathJax somewhere in the SE network?  If there is, how about adding a link to the guide on the Ask a Question page for SE sites which have MathJax enabled?

Currently, , ,  and  have MathJax support which turns LaTeX code into equation. At least on math, occasionally there are users that do not know this feature or don't know it's possible to use LaTeX (MathJax), resulting a badly formatted post. I suggest that there should be a common "LaTeX/MathJax typesetting help" page for those sites that enabled MathJax support, like the  that is present on all sites. Preferably, there should also be a line  LaTeX equations $\sin^2 \theta$  in the "How to Format" on the right hand side. See also:


sudo apt-get install gksu Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package gksu

When I try to install any package through the command line, I get an error.   $ sudo apt-get install <package> Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package <package>   Can anyone help me on this?


Hi I want to draw a performance profile directly from python, and the results of implementation are stored in lists, what can I do next? New to python, hope someone can help, thanks in advance.

and other coding contests often have a maximum time to run or people boast of how fast their particular solution runs. With Python, sometimes the approaches are somewhat kludgey - i.e., adding timing code to __main__.  What is a good way to profile how long a Python program takes to run?


Question: It is given that the series $\sum_{n=1}^\infty a_n$ is convergent, but not absolutely convergent and $\sum_{n=1}^\infty a_n=0$. Denote by $s_k$ the partial sum $\sum_{n=1}^k a_n$, $k=1,2,... $     then " it is possible"  that $s_k>0$ for all but a finite number of values of k ?    My attempt:   Define $$ s_k=\left\{\begin{array}{} 0&\text{if $k=2,3$ }\\[4pt] \frac1{k}&\text{otherwise} \end{array}\right. $$  Then clearly $s_k>0$ for all but a finite number of values of k (as required)  Further, $s_k$ converges to $0$ and  hence $\sum_{n=1}^\infty a_n=0$.   But $\sum_{n=1}^\infty a_n$ is not absolutely convergent (how can i prove it?)  Am i correct? Please help me

Let $\sum a_n$ be convergent but not absolutely convergent, $\sum_{n=1}^{\infty} a_n=0$,$s_k$ denotes the partial sum then could anyone tell me which of the following is/are correct?  $1.$ $s_k=0$ for infinitely many $k$  $2$. $s_k>0$ and $<0$ for infnitely many $k$  3.$s_k>0$ for all $k$  4.$s_k>0$ for all but finitely many $k$  if we take $a_n=(-1)^n{1\over n}$ then $\sum a_n$ is convergent but not absolutely convergent,but I don't know $\sum_{n=1}^{\infty} a_n=0$? so I am puzzled could any one tell me how to proceed?


What is the purpose of OEM unlock? What would happen to my device if I enable that option? Will it mean that my bootloader is unlocked?

I am using samsung galaxy j7, in the developer options there is a option "OEM Unlock" if I turn it on will it wipe my data?   Also does samsung locks bootloaders? My device is not tied to any carrier.


Can anyone please help me solve an infinite series:  $$\sum_{n=0}^{\infty} \frac{n}{2^{(n+1)}}$$  I put it in Wolfram Alpha and got the result that it converges to $1$  I know that the infinite series:  $$\sum_{n=1}^{\infty} \frac{1}{2^{n}}$$  Converges to $1$.  But my series is quite different as it has an additional $n$ term multiplied in, and I can't quite see how to solve it to arrive at result $1$.

How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method.  In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$


I am putting together a big document based in many other small ones, and, as it is, I have a lot of references, much more than I wish to order by hand.   Is there a way to number these references by order of their appearance and not in the order I wrote them in the bibliography?  Let's say something like this:  ...  The code is amazing (\cite{FirstGuy}) because it rules (\cite{SecondGuy}) and this is proven in \cite{ThirdGuy}  ...  \begin{thebibliography}{99}   \bibitem{ThirdGuy} \textbf{G. Third}. \emph{Consistent proves of amazing code} \bibitem{FirstGuy} \textbf{G. First}. \emph{Comments on amazing code} \bibitem{SecondGuy} \textbf{G. Second}. \emph{Code that rules}   should produce something like this:  ...  The code is amazing ([1]) because it rules ([2]) and this is proven in [3]} ...  [1] G.First. Comments on amazing code. [2] G.Second. Code that rules. [3] G.Third. Consistent proves of amazing code.   Is there a way to achieve this without using BibTex or similar tools? (because the effort required to import them is similar to sorting them by hand).  Thanks!

Can thebibliography be sorted by citation order? Or is there a solution with an inlined bibliography that can be sorted?  Not having an additional .bib file would be preferable.  My current bilbiography is inluded in the rest of the article inside a thebibliography block.  \begin{document} \section{Example} The citations in\cite{ne} the bibliography should\cite{flowers} be ordered  according which order they appear in the text.   \begin{thebibliography}{9}  \bibitem{fetebok} \emph{Internal Combustion Engine Fundamentals}  \bibitem{ne} \emph{Förbränningsmotorer}  \bibitem{flowers} \emph{HCCI Research Towards Development for Stationary Power  Applications}  \end{thebibliography}   Should output:  The citations in[1] the bibliography should[2] be ordered  according which order they appear in the text.   Bilbiography [1] Förbränningsmotorer [2] HCCI Research Towards Development for Stationary Power Applications [3] Internal Combustion Engine Fundamentals


A recent post on the Stack Overflow blog () states that the Stack Overflow team has implemented a voter fraud detection mechanism.  I look at the user board and noticed at least one user took a major hit as a result.  I'd like to know how it works.  No, not so that I can better circumvent it, but I'd just like to know that it is fair.

I just noticed that I lost a bunch of points from my reputation score, and I used the "reputation" tab on my user profile page to try and track down the cause.  During my investigation, I noticed there was an unusual event of type "reversal". In the normal place of a question title, it says "voting corrected".     What does this mean, and what caused it?  Did I do something wrong? Why did I lose all of that reputation? Is the system punishing me for leaving too many good answers?  Is there any way to earn it back?


I did something unbeknownst to me and have made my view constantly follow an object. If i move that object it remains constant in the center of my view while the rest of the scene moves around instead.  What is this setting? I've tried pressing . on the number pad and it did nothing.

I am starting to learn using blender, and at some point I managed to do something to the 3D view camera.  Usually the camera orbits around an object, but now the rotation seems to happen (atleast very close to) around the "camera's origin". Neither the input setting in "User Preferences", the pivot point selection nor Ctrl-Alt-Shift-C (as suggested on some forum) do anything to the issue.


While having a conversation, I say: "When you say atheist, most people would imagine an anti-religious person". What I meant by 'you' is actually anybody. When I am using 'you' in such a manner, what am I doing? Is there a name/word for it? Is it using a 'figure of speech'?   Thank you

What is the adjective (or phrase) describing the use of 'you' in place of anyone, everyone, or yourself in passing?  Such as the following -  ...and you wouldn't dare to eat the last cookie, especially if it were macadamia nut, as this has been the boss's favorite cookie  In the above, the speaker could be on a rant insinuating she would have enjoyed that last macadamia nut cookie, however decided against eating it as it is common knowledge that the boss would be interested in the very same cookie.  If the example were a failed quip, the speaker could combat the post-rant silence by exclaiming I was being facetious!, however in the above example the speaker would like to clarify the use of you by stating I was being [blank]  Any adjectives or phrases to describe the use of you in this situation?


Question is that :  Suppose a matrix $A\in M_n(\mathbb{C})$ is a commutator by which i mean $A=BC-CB$ for some $B,C\in M_n(\mathbb{C})$ then we see that Trace of $A$ is $0$  But Suppose a matrix is of trace zero can we say that it is commutator?  I have tried seeing this for $2\times 2$ matrices and end up with nothing reasonable..  I would be thankful if some one can suggest me a way to proceed in this case.

If $V_0$ is the subspace consisting of matrices of the form $C=AB-BA$ for some $A,B$ in a vector space $V$ then $V_0=\{A\in V|\operatorname{Trace}(A)=0\}$.  The problem above is one of the past qualifying exam problems. I can prove that  $V_0\subset\{A\in V|\operatorname{Trace}(A)=0\}$ but I do not know what to do with converse.  Thank you in advance.


Is it possible for me to use  in a Commander deck that does not use black? I am making a Blue, Green, and White commander deck, and I would like to add Westvale Abbey. Could I use it?

The official deck construction rules for Commander (nee EDH) at  say that 'A card's colour identity is its colour plus the colour of any mana symbols in the card's rules text.'  How does this apply to dual-faced cards with faces of different colors, such as  out of Innistrad or  from Dark Ascension, where the color of the transformed face of the card is different from the color of the 'main face'?  The spirit of the rules would seem to suggest that these cards are the colors of both faces for deck construction purposes, but not only are these spells always cast as the front face, the front face is the only one 'seen' in other game zones: for instance, when the card's in the library, you could find Elbrus by searching your library for an artifact, but you couldn't find Withengar Unbound by searching your library for a creature card.  Could Elbrus then, for instance, be played in any Commander deck, or just one with a (partly) Black general?


In the last episode of Westworld,       Maeve goes into a train which is going to leave the complex. She had a hard time going there, but on the last minute, she changes her mind and leaves the train to reenter the park and take part in the revolution.   So..      Why does she leave the train ? Was it a "robotic command" send to all robots, and thus, she could not resist ? Or was is her free-mind ? The memory (false) of her daughter ? Something else ?

In the season finale we learn that all of Maeve's escape related activities were       not actually a bug but pre-programmed, despite what Maeve thinks. In other words she had no free will in that scenario.   However at the end of the episode Maeve      sees a child on her escape train and is compelled at the last second to go back for her child.   Is this final action of Maeve a product of her own free will?       Did she 'solve the maze' like Dolores? Or was her return to save her child just as pre-programmed as the rest of her escape attempt?   Is there any specific evidence within the episode (or any other episode in the first season) that explains her actions?


Possible Duplicate:          Most commands I use in linux behave exactly the same whether I include the trailing slash / character on the end of a directory name or not.  For example:  ls /home/cklein ls /home/cklein/  cp foo bar cp foo/ bar/   When does this trailing slash matter?  What is the semantic meaning of the trailing slash?

I have a little question here.  If I have two files, say filea and fileb, mv filea fileb would   delete fileb rename filea to fileb   Then if I have two directories, say dira and dirb, mv dira dirb would   move dira into dirb (it will become dirb/dira)   Noting that in both cases there are no notice or message, then this is pretty inconsistent to me. I think mv dira dirb should just overwrite dirb with the contents of dira (or merge the two directories under a directory named dirb).  I remember reading somewhere that a directory name with a slash (like dira/) is treated like a directory, and name with no slash (like dira) is treated like a file (to certain extents, of course). Anyway now I want to make the shell (zsh and possibly bash) respect my notation of a directory by using a slash. Is there a terminal option which enable me to enforce that?  To clarify, here is my desired behaviour:   mv dira dirb results in dirb being overwritten with the contents of dira mv dira dirb/ results in dira being moved into dirb (in dirb/dira)   Has anyone thought the same way as me? Or am I just weird?


I'm trying to consume the rest of an input on cin. Currently my function does this ...  void foo() {     // Input "514 G Alex Thornton     std::cin >> INT >> STD::STRING >> STD::STRING }   So far the int variable consumes 514, and the first string variable consumes G; however, that leaves the name remaining, which can be an infinite amount of words. Is there a way to consume the rest of the line?


Is it merely an arbitrarily chosen definition that we created in order to quantitatively measure the  of an object or is it some other way around. I want to know what's the reason behind such a relation?   NOTE : I’m considering the fundamental case wherein the motion is uniform and is along a straight line.

I have a rather basic, maybe even dumb, question. I was wondering why speed is defined as it is:  $s = d/t$  Of course, what the equation means is not too difficult to understand. However, there are many ways that d and t could be related, for instance:  $s = d + t$  I am not sure who the first person to define speed was, but I was wondering how they made the decision to define speed as distance divided by time.


Are the following functions equal or one is the restriction of the   other?      $f(x) = \ln(x^2)$      $g(x) = 2\ln(x)$   My book says that $g(x)$ is the restriction of $f(x)$ to $\mathbb{R^+}$ and I can verify that on my calculator.  But that doesn't make any sense to me. Shouldn't $2\ln(x) = \ln(x^2)$ ? Or is it because my calculator does $\ln(x)$ first, and then multiplies the result by 2, and so $x$ cannot take a negative value?  Does that mean that these functions are analitically equal but diferent in practice? Or does this happen just because this is the way my calculator is programmed?  Can someone explain this to me?

If I have a function like this $f(x)=2 \ln(x)$ and I want to find the domain, I put $x>0$. But if I use the properties of logarithmic functions, I can write that function like $f(x)=\ln(x^2)$ and so the domain is all $\mathbb{R}$ and the graphic of function is different. Where is the mistake?


I am trying to read xlsx do documents, find specific lane and print an area, but w/o printing None-lanes. Also break the cycle when "None" is in specific column.  def some():     for r in range(1, ws.max_row):         for c in range(1, ws.max_column):             db = ws.cell(row=r, column=c)             if db.value == 'this one':                 for rows in ws.iter_rows(min_row=r + 1, min_col=c - 1,                                          max_row=r + 30, max_col=c):                     for cell in rows:                         if cell.value is None:                             if column_index_from_string(db.column) == c:                                 return                         else:                             print(cell.value, end=" ")                     print()   This code returns the only 1 lane and then break the head cycle. Output:  1315 text. Format of document: . I cant resolve this issue. Please excuse for native errors. I am new python and just looking for the answer.

Given the following code (that doesn't work):  while True:     #snip: print out current state     while True:         ok = get_input("Is this ok? (y/n)")         if ok.lower() == "y": break 2 #this doesn't work :(         if ok.lower() == "n": break     #do more processing with menus and stuff   Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?


I wish to check for proper user input as such (pseudo code)  userInput=""  #check until user enters 'y' OR 'Y' OR 'n' OR 'N'  while [[ "$userInput" != "[yYnN]" ]] ; do       read userInput  done   My idea is to use the [] wild card for matching but what is the proper way to accomplish this task?

The following code  number=1 if [[ $number =~ [0-9] ]] then   echo matched fi   works. If I try to use quotes in the regex, however, it stops:  number=1 if [[ $number =~ "[0-9]" ]] then   echo matched fi   I tried "\[0-9\]", too. What am I missing?  Funnily enough,  suggests this should work.  Bash version 3.2.39.


By default, Windows 10 (Pro) seems to open .pdf files in Edge - yuck! I picked Acrobat Reader instead - and for a while, it seemed to work.  Then, however, I suddenly get a message in the message center "An app association has been reset" (or something like that - mine is in German) - without any further explanation - and now Win10 is again opening all my .pdf files in Edge.  I keep doing this - sometimes more than once a day - but I can't seem to get Win10 to simply ACCEPT my choice of Acrobat Reader over Edge - this is HIGHLY ANNOYING !   Is there any way or hack to get Win10 to finally SHUT UP and just accept that I prefer opening my .pdf files in Acrobat Reader?

Every few days the file association for PDFs on my Windows 10 machine switches to Microsoft Edge.  I then right click on a PDF, choose "Open With -> Choose Another App", select Acrobat from the list, and check "Always use this app to open .PDF files".  Then for a few days it sticks, but always winds up going back to Microsoft Edge.  I haven't figured out a pattern to suggest when/why this happens.  It just does and is very annoying.  Does anyone have an idea of why this happens or how to permanently fix it?


I want an action to be executed conditionally, so I decide to reassign it to an empty function like this: public void ActionReassingnment1(bool doIt) {     bool myBool = true;     Action myAction = () => { myBool = false; };     myAction = doIt ? myAction : () => { }; }  I use myBool for my example lambda not to be empty, just placeholder not meaningfull logic. The problem is that without the intermediate variable myAction I cannot make the assignment directly in the true statement with the ternary operator like this: public void ActionReassingnment2(bool doIt) {     bool myBool = true;     //Action myAction = () => { myBool = false; };     myAction = doIt ? () => { myBool = false; }; : () => { }; //Error here }  Because of the ; of the () => { myBool = false; }; lambda I obtain that a : is expected. Makes sense, but then no matter what I tried I am not able to fit in the lambda directly. I tried wrapping the lambda with (() => { myBool = false; };) or {() => { myBool = false; };} with no success. Many time the compilation error I obtain is type of conditional expression cannot be determined because there is no implicit conversion between 'lambda expression' and 'lambda expression' It surprises me also that in the false statement, the lambda fits. Can a lambda be assigned in the true statement of the ternary operator? If so, how? If not, why then it is in the false statement?

Generally, when using the conditional operator, here's the syntax:  int x = 6; int y = x == 6 ? 5 : 9;   Nothing fancy, pretty straight forward.  Now, let's try to use this when assigning a Lambda to a Func type. Let me explain:  Func<Order, bool> predicate = id == null     ? p => p.EmployeeID == null     : p => p.EmployeeID == id;   That's the same syntax, and should work? Right? For some reason that doesn't. The compiler gives this nice cryptic message:     Error  1   Type of conditional expression cannot be determined because there is no implicit conversion between 'lambda expression' and 'lambda expression'   I then went ahead and changed the syntax and this way it did work:  Func<Order, bool> predicate = id == null     ? predicate = p => p.EmployeeID == null     : predicate = p => p.EmployeeID == id;   I'm just curious as to why it doesn't work the first way?  (Side note: I ended up not needing this code, as I found out that when comparing an int value against null, you just use object.Equals)


I have the javascript equation:  var sbal=pfWeight-gWeight-adjm; $("#result").html(sbal.toFixed(5));   If the result is 0, I assign the result the CSS color green. If it is not 0, I assign the result the CSS color red.  My problem is that sometimes the math comes out as -0 and thus displays as red.  I even tried   if(sbal===0){sbal=parseInt(0);}   sbal===0 returns true.   How can I work around this?    I know that  addresses WHY -0 = +0 but it does not supply and answer on how to fix the problem.

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


About 15 minutes ago someone managed to log in to my gmail account, and then added their phone number. I tried to follow the  but the problem is when it gets to the recovery part google says "we will send an alert to this phone number to verify your identity". That's not my phone number though, actually I never put a phone number on the account. I do have a recovery email set (and have had it since the day I created the account) but there doesn't seem to be any way to actually use it. Is there any possible way to recover my account now that the hacker has put their phone on it? EDIT: there is an old question that is similar, however the answers are out of date and no longer work. The link it tells you to click is no longer on the page. These are actually the same steps I tried originally (link above) and didn't work.

I have forgotten the password or username for my Google account, or I'm unable to access my account for other reasons.  How can I recover my account?  (This Q&A is meant as a general description for all Google and Gmail username/password questions. See: )


Dividend payments; where do they get paid into?

New to investing... Some stocks pay dividends but I'm not sure how they might affect my portfolio or in which measure this is important when evaluating a stock. I also don't know how to figure out if and when dividends will be paid.


$$\sum\limits_{n=1}^\infty {(-1)^n \over (2n+1) 4^n}$$  I know the methodology of solving this kind of equations, though I'm having trouble preparing the expression for integrating. I have no idea what to do with -1 and how to go to 2n power.

$1 + \frac{1}{3}\frac{1}{4} + \frac{1}{5}\frac{1}{4^2} + \frac{1}{7}\frac{1}{4^3} + ......$ Can anyone help me out how to solve this.   My try : I was thinking about the expansion of $tan^{-1}x$. But in that series  positive and negative will come alternatively.


I am working on a shell script that takes stdin or file as input and prints the averages and medians for rows or columns depending on the arguments.   When calculating the averages for the columns, the output needs to print out the following (tabbed):    My output currently looks like this (no spaces or tabs):  Averages:  92480654263  Medians:  6368974  Is there a way to echo out the averages and medians with tabs so each average and median set align left correctly? Here is a sample of how I am printing out the averages:  echo "Averages:"         while read i         do             sum=0             count=0             mean=0             #Cycle through the numbers in the rows             for num in $i             do                 #Perform calculations necessary to determine the average and median                 sum=$(($sum + $num))                 count=`expr $count + 1`                 mean=`expr $sum / $count`             done             echo -n "$mean"         done < $1

How do I echo one or more tab characters using a bash script? When I run this code  res='       'x # res = "\t\tx" echo '['$res']' # expect [\t\tx]   I get this  res=[ x] # that is [<space>x]


Tried searching online why it does this. I tried changing the redix of the parseInt method but it doesn't seem to change anything as well.    var sum = [6, 1, 4, 5, 3, 9, 0, 1, 9, 5, 1, 8, 6, 7, 0, 5, 5, 4, 3]  // digits.length returns 19 var wholeNumber = sum.join("") var makeNum = parseInt(wholeNumber) console.log(wholeNumber) // returns string: 6145390195186705543 console.log(makeNum); // returns int: 6145390195186705000     Can anyone explain why makeNum does not return me the integer of wholeNumber but rather replaces the last 3 digits at the back with zeroes. I t

Is this defined by the language? Is there a defined maximum? Is it different in different browsers?


I need to put the IP of my VPS machine into a variable. I mean to the external IP address appearing the value of inet addr section, in ifconfig output.  I've tried:  ipa="$(hostname -i)"   But echo ${ipa} brought the localhost token: 127.0.1.1, so I looked for other solutions and all I found includes many pipes and awk operations which I know nothing about (never used awk and I'm not very familiar with regex).  I tried this:  ipa=$(ifconfig | grep "inet addr:[0-999]\.[0-999]\.[0-999]\.[0-999]")   But it failed given that echo ${ipa} has an empty line of output.   Why did what I've tried failed or at least how would you solve it?

How can I get my own IP address and save it to a variable in a shell script?


I'm using Xioami MI 9 SE. Over the past day or two, I've started experiencing mysterious crashes on startup with several applications, including a Radio receiver app (local to Israel); Opera occasionally, APKPure; and one or two others. Now, I noticed other people experiences something similar on their Samsung phones, and also a few new items about a multi-app-crash issue:  so I thought my situation may be related. However, the workaround suggested at the link doesn't work for me, since MIUI doesn't even show an "Android System Webview" app. So, could it be the same issue? ANd - how do I restore my system to working order? Note: Downloading and installating the latest APKPure version does not seem to resolve the crash.

Recently, apps that are fine an hour ago now crash when I open them. The crash report message seems to be caused by a null pointer exception (NPE) in com.google.android.trichromelibrary. Apps affected for me:  Gmail Dashlane  Is it just me, or is there actually something wrong with the library? How can I fix these affected apps? Crash report: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'Xiaomi/polaris/polaris:10/QKQ1.190828.002/20.9.4:user/release-keys' Revision: '0' ABI: 'arm64' Timestamp: ... pid: ..., tid: ..., name: com.dashlane >>> com.dashlane <<< uid: ... signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 Cause: null pointer dereference          ...  backtrace:     #00 pc 00000000038621f0 /data/app/ com.google.android.trichromelibrary 438909034-YaxP9ttrIDcQBfleP5vm7Q==/base.apk! libmonochrome_64.so (offset 0x646000) (BuildId: ... )  (click  for the screenshot of the bug report)


What is more natural to say: To collect someone from reception (airport, train station, waiting room) or to pick someone from reception? Or is there something more appropriate?  What would a receptionist say to someone having an appointment: "Please, take a seat; someone from company ABC is on the way to collect (?) you". I heard that sentence so many times, and still, it's hard to believe, I cannot remember what the phrase is!?  Collect is typically used to collect a thing: a parcel from a post office. Could it also apply to humans?  To pick has several unwanted connotations too: to pick a girl, to pick on someone, to pick a target (sniping in game) etc..

A lady (of West Indian ancestry) said at a Church meeting this weekend: "He picked me at the station." Obviously, she meant what I would mean by saying: "He picked me up at the station," which would not be the smutty interpretation. I think I have heard this expression used similarly once before.  On the 'Wordwizard' website, we have only come up with a few opinions as to whether the shortened form is (a) now generally acceptable, (b) dialect or slang, or (c) erroneous grammar. Certainly, the examples we've been able to find on Google are accompanied almost invariably by obviously wrong grammar or excesses of sentence fragments.  Has anyone any experience of (or sound statistics on!) the shortened usage, please?


In , the answer shows this menu:   However, I don't see the 'Lock Screen' section. I'm trying to change the 'Adjustment' setting for my lock screen wallpaper.  Was this removed? If so, how do I edit this setting?

Up until a couple months ago, if I changed my wallpaper/background image, I could choose between tile, zoom, centre, scale, fill or span.  These options no longer appear in GUI for changing the background image. I am using Ubuntu 17.10.


The Dirichlet Kernel $$D_N =\frac{\sin(N+1/2)x}{\sin x/2}$$ How to show this  $$\frac{1}{2\pi}\int_{\pi}^{\pi}|D_N|dx=\frac{4}{\pi^2}\log N+O(1)$$

Let $D_n(x)$ be the Dirichlet kernel defined by $$D_n(x):=\frac{\sin\frac{(2n+1)x}{2}}{2\pi\sin\frac{x}{2}}$$where $D_n(0)$ can be set to  $\frac{2n+1}{2\pi}$ if we desire it to be continuous. Another expression for $D_n$ is $$D_n(x)=\frac{1}{\pi}\Bigg(\frac{1}{2}+\sum_{k=1}^n \cos kx \Bigg).$$I read that $\lim_{n\to\infty}\int_{-\pi}^{\pi}|D_n(x)|dx=+\infty$, but I cannot prove it rigourously. How can it be done? Thank you so much!!!


I would like to list all artist's tracks order by track length. artists     albums        tracks ----------  ------------  ------------ id          id            id name        artist_id     album_id             name          name   or artists     albums        tracks ----------  ------------  ------------ id          id            id name        artist_id     album_id             name          artist_id                           name  Less data in the first database, but easier queries in the secont database. Which is better?

Why do database guys go on about normalisation?    What is it? How does it help?    Does it apply to anything outside of databases?


I have a html file and two JavaScript files, one is the main, and the other contains a function that I want to import into main. For example - main.js: import {someFunc} from "./function.js"  randomVariable = 50;  someFunc()  exporting.js: export someFunc() { return 'foo'; }  HTML Tags (in < head >): < script src="./main.js" type="module" defer >< /script > < script src="./exporting.js" type="module" defer >< /script >  When I import the function into main.js, for some reason I get this error: Uncaught ReferenceError: randomVariable is not defined Which means that the variable I defined in main becomes undefined. When I merge the two files back together without importing / exporting anything, everything works fine.

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I currently use a website tracking program which downloads the HTML code of a webpage. It then asks for two search strings which surround the target code you wish to monitor then does some other stuff etc etc.  My question is, how would I access the HTML code of a HTTPS site through windows forms (C#) so I can make my own program?

I'm writing a program that reads content from a user provided URL. My problem is in the code that goes something like this: Uri uri = new Uri(url); WebRequest webRequest = WebRequest.Create(uri); WebResponse webResponse = webRequest.GetResponse(); ReadFrom(webResponse.GetResponseStream());  And this is breaking if the provided url is an https:// URL. Can anyone help me with changing this code so that it will work with SSL encrypted content. Thanks.


I am trying to simulate diode bridge using 12.  In the image below you can see the circuit and the simulation of the circuit.  So my question is, why does this circuit does not behave as full-wave recitifier? It is only passing a half wave, the negative one.  Thanks for the help!!!

Hi I have a Diode Bridge as outlined in the image below. As you can see I am getting a negative voltage on one pair of diodes instead of this voltage being flipped to positive.   Can you see anything wrong with my design or does it look like the simulator program getting it wrong?    Using Every Circuit Simulator on Android.


By the rules, according to the sage advice compendium actions and bonus actions are not interchangeable.  I can completely see why you shouldn't be allowed to perform an action as a bonus action, because the action economy is a big part of balancing.  However I do not understand why you shouldn't be allowed to perform a bonus action as an action. For example the description for spells with a casting time of bonus action in the PHB 202 states:     A spell cast with a bonus action is especially swift   So if the spell is just faster, why can't I use my action to cast it and then stare wholes in the air with the rest of the time?  To me it seems reasonable to allow players to use abilities that need a bonus action as their action. So I am considering house ruling this, because it comes up rarely but if it does it's annoying for the player that he can't.  In our special case the fighter/barbarian multiclass just got hit quite hard and he wanted to use his action and bonus action to rage and second wind for the damage resistance and heal. I didn't allow him because I knew that by RAW it's not allowed. But thinking about it I don't really see a reason to forbid him.  So my question is: Are there any balance implications if I allow my players to use their action to make bonus actions?  If important, we are only playing with official and tested content, namely PHB, DMG, MM, VGtM, SCAG and XGE.

It has come up in game a couple of times that a player might want to cast a spell that has a casting time of 1 bonus action using their "main" action (if they have another bonus action they also want to take on that turn, such as giving bardic inspiration, or controlling a Bigby's hand, etc.)  On the face of it, it seems obvious that something (a bonus action) that is usually much faster than a full action could be done as your full action.  Although the question comes up most often with respect to spellcasting, if I house rule this, I would rule that any bonus action can be taken as a regular action instead; however, I would not allow the same type of bonus action to be taken twice (so no giving bardic inspiration to two allies on the same turn, for instance).   Are there any abusive or overpowered combinations I should be wary of if I were to allow a character to take 2 bonus actions instead of one regular action and one bonus action on a turn?   The issue of casting two bonus-action spells would not come up because the rule against casting 2 spells on your turn unless one of them is a cantrip with a casting time of 1 action would still be in effect:  PHB p. 203 (under Bonus Action casting time)     You can't cast another spell during the same turn, except for a cantrip with a casting time of 1 action.   I know it's hard to prove/justify a negative answer to a question like this, but I'd be happy to get answers that say you don't think there would be any issues if you describe how you came to that conclusion.


I'm a new Ubuntu user trying a first install.  I've just built a PC and everything went smooth right up until the Ubuntu login screen.  I am prompted to type in my password, I do, and nothing happens.  It goes right back to the login screen.  If I type in a wrong password it informs me the password is incorrect.   When the password is correct nothing happens.  Thanks for any help you can provide.  This is my first PC build and attempt at any type of linux.

My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.   I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M