Building geometry in ArcPy from a table of coordinates and maintaining their attributes in the output

I've created polygons from a table that has two columns- an OBJECTID and a string of coordinates (Polygon_Coordinates). The resulting polygons (called "testing" in the code below) are in the correct locations, but I can't seem to figure out how to carry over the ID, which I need for a join later in the workflow. Any idea on how to build geometry, but maintain the attributes? I'm working in ArcGIS Pro. fields = ['Polygon_Coordinates', 'OBJECTID']  with arcpy.da.SearchCursor(table, fields) as table_cursor:     for row in table_cursor:         #skip null rows         if row[0] != '-9999':                          #turn string of coordinates into a list but split them at the commas             coords= list(row[0].split(','))                          #break up list into list of pairs             pairs = [coords[i:i + 2] for i in range(0, len(coords), 2)]             coord_ints = [[float(i) for i in p] for p in pairs]              #create insert cursor for geometry creation             geocursor = arcpy.da.InsertCursor(testing, ["SHAPE@"])             array = arcpy.Array()                          #grab pairs from list, put into array             for a in pairs:                 array.add(arcpy.Point(a[1],a[0], ID=row[1]))                          #set crs, build polygon              wgs = arcpy.SpatialReference(4326)             poly = arcpy.Polygon(array, wgs)             geocursor.insertRow([poly])


Can two people share two Dropbox accounts on a single Windows user account?

my partner and i share a computer (windows 7) and have just one user profile, so we don't have to log in and out all the time, can we both install dropbox and have two different dropbox folders for two different dropbox accounts on the same user profile?


Do any commands exist that would let me copy the last line of the previous output to my clipboard?

I'm not sure if this should be here or over on AskDifferent, but I'm using a bash shell (iTerm) on MacOS. I sometimes have commands that produce additional commands that need to be copy/paste to the terminal.  An example of this is logging into the aws ecr:  aws ecr get-login --no-include-email --region -eu-west-1  This produces a multiline login hash that you need to copy and paste to the shell in order to successfully authenticate. Is there a way I can this and paste it from the keyboard or some command?  I've seen several ways to copy all of the output from a command to clipboard, but that's not exactly what I'm asking for. Specifically, I typically only want the last line in the output.  If nothing exists, I'd be perfectly happy with just setting up some sort of alias in my .bashrc  The recommended dupe answer expects you to use screen - I don't want to use screen


Proving $a_{n+1}^2=a_n·a_{n+2}+(-1)^n$ for Fibonacci sequence $\{a_n\}$

Let $a_1,a_2,a_3,...,a_n$ be the sequence of Fibonacci numbers.  Then we are required to prove by induction that $$a_{n+1}^2=a_n \cdot a_{n+2} + (-1)^n$$  My Attempt:  Initially putting a few values like $n=1,2 \: \text{or}\ 3$ makes it certain that we can move ahead.  Following the conventional way we can assume that the proposition holds true for some $k$ s.t.$$a_{k+1}^2=a_k \cdot a_{k+2} + (-1)^k  \tag1$$  To prove that the proposition holds for all values of $n$, we need to prove for the same for $n=k+1$ too.  In short we need to prove that: $$a_{k+2}^2=a_{k+1} \cdot a_{k+3} + (-1)^{k+1}  \tag2$$  We know that   $$ a_{k+2}^2=(a_{k+3}-a_{k+1})^2$$ $$\Rightarrow a_{k+2}^2=a_{k+3}^2+a_{k+1}^2-2\cdot a_{k+3}\cdot a_{k+1}$$ $$\Rightarrow a_{k+2}^2=a_{k+3}^2+a_k \cdot a_{k+2} + (-1)^k-2\cdot a_{k+3}\cdot a_{k+1}$$ $$\Rightarrow a_{k+2}^2=a_{k+3}[a_{k+3}- 2\cdot a_{k+1}]+a_k \cdot a_{k+2} + (-1)^k \tag{*}$$  It is easy to see that $$a_{k+3}-a_{k+1}=a_{k+2} \tag3$$  And $$a_{k+2}-a_{k+1}=a_{k} \tag4$$  Adding equation $3$ and $4$, we get$$a_{k+3}-2a_{k+1}=a_{k} \tag5$$  Putting eq$(5)$ in eq$(*)$   $$a_{k+2}^2=a_{k+3}[a_k]+a_k \cdot a_{k+2} + (-1)^k $$ $$\Rightarrow a_{k+2}^2=a_k[a_{k+3}+a_{k+2}]+(-1)^k $$ $$\Rightarrow a_{k+2}^2=a_k(a_{k+4})+(-1)^k$$  This I indeed completely different from something that I wanted to prove. Is there any way to get ahead of this or is there something wrong with what I have done?


How to burn an Ubuntu ISO image on a DVD on Ubuntu?

I have a Ubuntu image file (.iso) and I'd like to burn the image file into a DVD, is there any software for this purpose on Ubuntu?


Is there any way to end beast form early? I find myself using it to clear out a particularly hard portion of a dungeon at times, but then I have to sit around for 2-5 minutes so I can be my human character again (I have to feed to keep my health up, so I'm a werewolf longer than the 2.5 minutes).  Is there anyway to end it early?


Turn off automatic loading of MMS messages

A  is said to exploit MMS loading.     For now, there's not much end users can do to protect themselves other than to install a patch as soon as one becomes available for their specific Android device. People can also prevent MMS messages from automatically loading in Google Hangouts or other text apps. That will prevent malicious code from being automatically loaded [...]   How to disable automatic loading of MMS messages?  If it depends on the app, the procedure for the most popular apps would be appreciated.


I have a page with a url of:     domain.com/page.jsp?pID=01   And I have code:  <% String pID; %> <% if (request.getParameter("pID") == "01") { %>      <%@include file="page01.jsp" %>              <% } else if (request.getParameter("pID") == "02"){ %>      <%@include file="page02.jsp" %>              <% } %>   All I get is a blank page.  Why is this?


How to enable "Other" or "Manual" user login in ubuntu 14.04.1?

I found the other one with the lightdm thing but it doesnt work because its for 12.04! does anyone know how to enable the manual login like in XUbuntu where you can type in the user and the password?  Thanks


"in which people study" or "where people study on"

Should it be:     Campus is a place in which children study.   or     Campus is a place where children study on.   Which one is correct, or are they both incorrect? Why?   Is there a better version?


What is the benefit of using HEXADECIMAL over DECIMAL

I saw may programmers using HEXADECIMAL number to describe value and I was wonder what is the BENEFIT of using HEXADECIMAL instead of regular decimal number.  For example :  <?php  fread( $myFile, 0x594 ); //vs fread( $myFile, "1428" );  ?>   And more importantly,  How do I get to that hexadecimal value ?  I was trying echo hexdec (1428); and I'm receiving 5160 and not 0x594.  What am I doing wrong here ?


How can I run Visual Studio for mac as administrator?

I use Visual Studio for Mac Community 8.4.1 (build 4) on my iMac. How can I run Visual Studio as administrator? How can I find out if I am in administrator mode?  I need to have rights to read a file that is located in desktop directory:    string assetPath = "/Users/myname/Desktop/Level2.txt";   try   {       File.SetAttributes("/Users/myname/Desktop/Level2.txt", FileAttributes.Normal);       byte[] fileContents = File.ReadAllBytes(assetPath);   }   catch (Exception e)   {       Console.WriteLine("Exception :" + e.ToString());   }   My code is not working. I get this error message:  "Access to the path \"/Users/myname/Desktop/Level2.txt\" is denied."   Why is the access to the path denied? Will it help if run Visual Studio as administrator?


Let $A\in\Bbb{K}^{n\times n}$ and $\mu_A$ the minimal polynomial of $A$. How can I show that $A$ is invertible and only if $\mu_A(0)\neq0$?

Let $\mathbb K$ be a field, $n\in \mathbb N$, $A\in \mathbb{K}^{n\times n}$ and $\mu_A \in \mathbb{K}[X]$ the minimal polynomial of $A$. How can I show that $A$ is invertible and only if $\mu_A(0)\neq0$?


I'm pretty new to web development (coming from an AV control system programming background) and am trying to do something that I'm convinced has to be super easy, but I'm coming up short. Basically I've created an array variable of buttons on a document, and need to determine which button was pressed. For example, let's say I have four buttons with ID's "id1" - "id4" Here's what I've got in JS:  $(document).ready(function(){     var sourceBtns = [];     var lastPressedIndex;     for(i=1;i<=4;i++){        sourceBtns.push(document.getElementById("id"+i));    }     for(i=1;i<=sourceBtns.length;i++){        sourceBtns[i-1].addEventListener("click",lastPressed);    }      function lastPressed(){              //need to assign lastPressedIndex here    } });


ADC for measuring 0-5V but connected to 3.3V device

I have a  (BB) and want to connect the analog output of a motor controller to it. The motor controller creates an output in the range of -4V to +4V and the BB anlog inputs only accept voltages between 0V to 1.8V (digital  pins run at 3.3V). I only have a comparably small limited space of perfboard available, but 4 motors to monitor. I can provide 5V and 3.3V supply and 1.8V ref Voltage. Here are the options I found so far:   Make an op-Amp circuit to convert [-4..4] to [0..1.8]. Probably a nice way, because I could use directly the BB-ADCs, but I am not to confident with these circuits (I found this ) and I would need one for every input which seems to be to many parts/space. Use an ADC and connect it via I2C: The  seems to provide exactly what I want. Single 5V supply, analog input range between [-5..+5] and I2C interface. I would really like to use this one, the only problem I have is that according to the data sheet digital high is seen as 0.7*Vdd = 3.5V. I do not now if 3.3V would be detected correctly (anyone has experience with that?). Pulling up to 5V is not possible as the BB is not 5V tolerable. The  is basically the same as the Max127 but with SPI-interface. There the data sheet states the digit high threshold is 2.4V. I know that the I2C slave only pulls down. How does it work with spi, because the data sheet mentions digital outputs voltages (which are Vdd)? Lose some resolution and only use the output range from [0..4]V. That gives a larger variety of possible unipolar ADCs, but most of them have the same limitation with 0.7*Vdd for digital high signals. As in 4. But use ADCs with 3.3V supply voltage which have a range of [0..5], but I could not find any with 4+ channels.    I believe that I somehow going in circles. Does someone know a viable solutions or how to address the mentioned problems of (at least) one of the above described?  I would generally prefer through hole parts (as it's perfboard) but I could probably get some small breakout boards for SMD-devices as well.


Stability of injective, surjective and bijective functions under composition

Let $$f :  A \to B, \quad  g: B \to C, $$ be two functions. Show the following:  1) If $f$ and $g$ are surjective then $g \circ f$ is surjective   2) If $f$ and $g$ are bijective then $g \circ f$ is bijective.  3) If $g\circ f$ is injective then $f$ is injective.  4) If $g \circ f$ is surjective then $g$ is surjective.  5) If $g \circ f$ is bijective then $f$ is injective and $g$ is surjective.  How can I prove the following statements ? I assume that I can say that 2) is bijective If I can prove 1) (I know $g\circ f$ is injective)  A little bit help would be awesome thank you...


Can I uninstall and reinstall Ubuntu Software Center?

Since migrating to a true install and upgrading to 12.04 I have had several problems that seem to relate to the Ubuntu Software Center. Hanging at applying changes and blank screen on screen lock only when it is running, for instance.  My question is: Can I safely uninstall and reinstall Ubuntu Software Center and could this possibly fix those problems or are they just bugs I have to wait for updates for?


I have the model of a man formed by jacket, trousers, shoes, hands and head, all joined with CTRL J. When I go to create the armor he gives me "heat-weighting-failed-to-find-solution-for-one-or-more-bones". I tried to apply the scale, rotation, and location but nothing. I tried to remove doubles but nothing, and I even deleted a lot of faces, vertices and edges. I don't know what to do anymore!


Displaying intersecting roads and creating multiple labels for long roads in QGIS?

I am new to GIS and I am using QGIS 1.7.3 on Windows.  Can any one tell me how to display a map from line shapefile with these two characteristics:   Roads are displayed with borders at the sides and intersect at crossroads Name label for long roads are duplicated at specified intervals   Here is the link to an image that illustrates my idea:    (The map was taken from underdark's blog)  This is the best I can achieve by drawing lines with two overlapping simple line, one slightly bigger than the other:


I am trying to understand the work-energy theorem, and on my book there is the following example which I find a bit confusing: A point of mass $m$ moves up from the lowest part of on an inclined plane with initial velocity $v_{0}$. Find the height at which the point stops. So the solution is just $\frac{1}{2}mv_{0}^2 = mgh$ and then it easy to find h. My doubt is about the fact that is just uses $h$ instead of $h \cos\theta$. Is it because work is a scalar quantity? Or because it's a conservative force? Thanks a lot Edit: sorry, found answer here:


My boyfriend (Peruvian citizen) is coming to visit me in the Philippines. He has a connecting flight to Narita airport that has a 2hour layover. Does he need a transit visa?


I installed a game; where can I find it?

I just downloaded the Snake game by installing the package gnome-nibbles.  I can find it on the terminal but not on the desktop....  Where is it?  How can I add a shortcut to the game on the desktop?


In QGis, why do parts of the OpenLayers layer export in a different scale and position?

I have a problem printing with google satellite maps in QGIS. In the composer it's all right, but in the pdf file some portions of the image are in a different scale and in a different position.  An image can talk more then 1000 words…    EDIT: My problem isn't misalignment, and the problem occurs independently from size or position. It's something like the bug of which talk about in . How can you watch in the image that I inserted before, the correct image is the portion at the center, while the rest is in a scale smaller (the street above can't be bigger than the houses).


$SO(3)$, orbital angular momentum, vector product

I have a big confusion with group theory terminology. I know that orbital angular momentum (OAM) is $\mathrm{SO}(3)$-symmetric in 3D-space. Let's define QM orbital angular momentum (OAM) conventionally:  $$\pmb{L} = -i \pmb{r} \times \pmb{\nabla}$$  This definition can also be written using a set of $\mathrm{SO}(3)$ generators:  $$L^{\mu} = -i r_i \; S_{ij}^{\mu} \; \nabla_j$$  where $\mu = \{x,y,z\}$ for 3D space, and $S_{ij}^{\mu}$.  So... generators stand for the definition of a vector product in given space, essentially, definition of orthogonality? Or this is only in this case, I suppose, in which case why such a coincidence?     If I proceed with this:  $$\pmb{r} e^{-iS^{\mu} \phi} \pmb{p}= \pmb{r} \cdot \pmb{p} - i \delta \phi \; \pmb{r} S^{\mu} \pmb{p} + \cdots = \mathrm{const} \; e^{- i \pmb{r} \cdot \pmb{p}} + \delta \phi L^{\mu}$$  Matter wave in zeroth order and OAM in first? Does it have any interpretation?


How many solutions are there to $x_1 + x_2 + ... + x_5 = 21$?

How many solutions are there to the equation      $x_1 + x_2 + x_3 + x_4 + x_5 = 21$    where $x_1, i = 1,2,3,4,5$ is a nonnegative integer such that $0 ≤ x_1 ≤ 3, 1 ≤ x_2 < 4$, and $x_3 ≥ 15$?  I have correctly completed the previous parts of the question but am having trouble with this particular restriction.  The total number of solutions to the equation is $C(25,21) = 12650$.  I have tried to do each restriction individually:  For $0 ≤ x_1 ≤ 3$, I solved this by subtracting the number of solutions when $x_1 ≥ 4$ from the total number of solutions. This is $C(25,21) - C(21,17) = 5985$.  For $1 ≤ x_2 < 4$, I have $C(24,20) - C(21,17) = 5985$.  For $x_3 ≥ 15$, I have $C(10,6) = 210$.  However, the restriction is when these are all together. I am not sure how to proceed. The answer is $106$.


Direct product of groups and isomorphism

Let $A, B, C$ three groups such that $A \times C \cong B \times C$. I already know that if $A, B$ and $C$ are abelian and finite, then $A \cong B$. I think this result does not hold anymore if they are not supposed to be finite or abelian. Is it possible to give a counterexample ?  Thank you very much for the help !


How will leaving a computer to run overnight affect my CPU,Battery,iGPU,RAM,HDD?

Would anything happen to my computer if I left it overnight to download something, such as my battery life going down or something similar happening?


If I have two samples of spatial distribution (tweets), how do I test if they're from the same distribution?   What are model is usually used to represent distribution of tweets?  The data I have are scraped from a specific hashtag, containing user id, caption, location, time. It's tourists' data so it's very random, concentrated around tourist attractions. Here's an example


Game-Checking for collisions and deleting object from ArrayList

I am doing some kind of arkanoid, and I got stuck. The way I do it is through JFrame, JPanel and with Timer. So what I do each timer update is  this      public class Controller implements ActionListener{      @Override     public void actionPerformed(ActionEvent e) {        ball.move();        desk.move();        deskCollision();        squareCollision();        repaint();      }   }   I created Arraylist of squares, and I printed them. When I check the collision with squares and ball, it works. So now I want to remove a specific square, when a ball hits it and change direction of a ball. Firstly, I tried it without any kind of a loop, like this.  if(ListOfSquares.get(24).getBounds2D().intersects(ball.getBounds2D())){         ball.dy = 1;         ball.dx = -1;         ListOfSquares.remove(24);     }   This works as well. But as I want to make a loop which will go trough all of the squares and always remove the specific square, I am lost. I have done it like this, but  it ends up with a bug  -- Exception in thread "AWT-EventQueue-0" java.util.ConcurrentModificationException --    for(Square square : ListOfSquares){        int index = ListOfSquares.indexOf(square);        if (ball.getBounds2D().intersects(square.getBounds2D())) {            if(ball.dx == -1 && ball.dy == -1){            ball.dy = 1;            ball.dx = -1;            ListOfSquares.remove(index);            }            //etc...        }    }             Thanks for your help.


Rendering multi-layer EXR leaves small gaps between layers

I know this is kinda a hybrid issue, but I think the problem here lies mostly with Blender.  I've rendered a multi-layered EXR file of a character I did in Blender to color and adjust it further in Photoshop. Arms, legs, head and so on are all on separate layers for easier access.  But as you can see in this picture, there are very thin gaps between each layer of like 1 pixel. Sadly they are visible even from afar and make the image look ugly.    Is there a way in Blender to circumvent this? I know this is a very specific question, but maybe someone has an idea.


I'm in doubt about this problem! How do I show that $3(1^2 + 2^2 + ... + n^2)$ is divisible by $(1+2+...+n)$? I thought about using that $ (1 + 2 + .. + n) =\frac{n (n+1)}{2}$ and that $(1^2 + 2^2 + ... + n^2)=\frac{n (n+1)(2n+1)}{6}$, but it didn't work out very well! Can someone help me? Thanks.


How to install ubuntu on a partition other than windows partition

I have windows 7 professional 32bit installed on my Local Disk (C:) and I want Ubuntu 13.10 to be installed in Local Disk (E:) Which I have a lot of free space in. I have the Live CD. Can someone please help me with this issue ?


Variance of sum of $k$ randomly drawn numbers from $1,...,n$.

From an urn with numbers $1,...,n$ we draw $k < n$ numbers without replacement.   Let $X_i$ be the $i$-th draw. The random variable is their sum $X=\sum_{i=1}^kX_i$.  I have already calculated the expected value of the sum, which is   $$\Bbb{E}[X]=\sum_{i=1}^k\Bbb{E}[X_i]=k\frac{n+1}{2}$$ because each $\Bbb{E}[X_i]=\frac{1}{n}\sum_{i=1}^n i=\frac{n+1}{2}$.  Now the variance of the sum would be $$Var[X]=\Bbb{E}[X^2]-\Bbb{E}[X]^2$$  I have read that the variance of a sum is the sum of variances if the random variables are independent, it does not seem to be the case here, as previous draws determine future draws.  Is there an elegant way to determine the first summand of the variance?    Edit: I am trying it the ugly way.  $\Bbb{E}[X^2]=\Bbb{E}[(\sum_{i=1}^kX_i)^2]=\Bbb{E}[\sum_{i=1}^k \sum_{j=1}^k X_iX_j]=\sum_{i=1}^k \sum_{j=1}^k \Bbb{E}[X_iX_j]$  To know $\Bbb{E}[X_iX_j]$ we would have to know $\Bbb{P}(X_iX_j=k)$, meaning we would have to know the number of ways to write a number as the product of two factors $1\leq X_i, X_j \leq n$... I am pretty sure I am off the track here, as I do not see a way to do it for a general $n$.    Am I wrong to regard the $X_i$ instead of the $X$, which are independent, as two draws of $k$ balls would be independent? Then $\Bbb{E}[X^2]=\Bbb{E}[X]\Bbb{E}[X]$


Edited:  It is known that if $f$ is differentiable then the derivative function of $f$ is not always continuous. For instance $f(x)=x^2\sin (\frac{1}{x})$ for $x\neq 0$ and $f(0)=0$ if $x=0$. Then $f^{\prime}$ is discontinue at $x=0$.   Is there any differentiable function $f$ whose the derivative of $f$ has countable points of discontinuity?


Every finite extension of the field with characteristics $0$ is simple extension.

We, know every splitting field a finite algebraic extension. So, therefore every splitting field over the field with characteristics $0$ is a simple extension. But, here I choose the irreducible polynomial $x^{3}-2 $ in $\mathbb{Q}[x]$. Then , the splitting field of $x^{3}-2$ over $\mathbb{Q}$ is $\mathbb{Q}[\sqrt[3]{2},\sqrt{-3}]$ , But , now how could this extension $\mathbb{Q}[\sqrt[3]{2},\sqrt{-3}]$ generated only by one element? Also, how to show that Every finite extension of the field with characteristics $0$ is simple extension ?


I want to send a reminder email to the users to log in to my website with their username and password. My mail script is ready with the login ID, but I don't know how to decrypt the user's password.    Can anyone tell me how should I get the password associated with a user account?


how to correct topology after boolean operation?

So I have used the boolean operation to create a spherical hole inside a cube and was wondering how I could correct the topology. The result of this was:  So I was wondering how I can edit the topology so I can use subsurface modifier or if it is better if I Use a different method to create the hole. If I should recreate it a different way than what would be a good way keeping in mind that this is from a cube. Thanks!


Linking the color of one mesh to a second mesh

I have a series of tubes that were inputted as VRMLs with varying colors. I have made a path out of them and have the sphere following the tubes. I want to link the color of the sphere to be the same as the tube while the sphere is traveling in time over the tubes. How can I link the colors? I also want the sphere to glow with the color of the tube.


After Installing Hyper V Windows 10 detects extra generic PnP monitors

After enabling Hyper-V on my Windows 10 laptop I have 5 extra generic pnp monitors detected in my display settings panel and in my device manager. When I remove the Hyper-V feature these monitors are gone.  When I now connect an extra display to my HDMI port and I want do duplicate my second screen is never on a same display number. So today I extend display 1 and 6 but tomorrow it can be 1 and 5.  I am using a Dell Precision M2800  Any ideas why this happens?


PHP - Read x-www-form-urlencoded duplicate keys into an array

I'm working on an API endpoint that takes a POST request of form x-www-form-urlencoded. This mostly takes your typical set of string values, but in some cases, the values can be an array, which come in as duplicate keys, like so: name1=foo&name2=bar&arr=value1&arr=value2&arr=value3 I want to end up with the following: [   'name1' => 'foo',   'name2' => 'bar',   'arr' => [value1, value2, value3] ]  I've tried the following: filter_input_array(INPUT_POST, [   'name1' => FILTER_SANITIZE_STRING,   'name2' => FILTER_SANITIZE_STRING,   'arr' => [     'filter' => FILTER_DEFAULT,     'flags' => FILTER_FORCE_ARRAY   ] ]);  which gives me (     [name1] => foo     [name2] => bar     [arr] => Array         (             [0] => value3         )  )  and parse_str(file_get_contents("php://input"), $params); which gives me: (     [name1] => foo     [name2] => bar     [arr] => value3 )  In both cases, the duplicate keys are overwritten, and I only get the last value. The top comment of the  function mentions that it does not parse duplicate keys in the CGI standard way, and presents a hefty function to manually parse out the fields. I'm wondering if there is a simpler way to do this, I simply want to get a sanitized array of all the input from the x-www-form-urlencoded POST call. Ideally just something like return filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); // also FILTER_SANITIZE_ARRAY for duplicate keys Is there any function that can accomplish this basic task, or do I really need to roll my own? If so, what's the best way to blanket sanitize an arbitrary user-input array coming in via this POST method, since I would wind up just using a function similar to that in the linked comment above?


Show that the sequence $x_{n+1}=1+\sqrt {x_n}$ is convergent

Let, $x_1=1$ and for all $n\in \Bbb N$, $x_{n+1}=1+\sqrt {x_n}$. Prove that the sequence is convergent.  I'm unable to how the sequence is monotonic increasing ! We have, $x_{n+1}-x_n=1+\sqrt{x_n}-x_n$. How can I say this is $\ge 0$ ?n Or any other way to prove this ?


Where can I find details of the bus between Tbilisi Georgia and Baku Azerbaijan?

WikiTravel and other easily Google-able sources tell me there are buses that run between the Georgian and Azeri capital cities, but no details. I'd like to know the follow for a Chinese guest who just arrived at my hostel in Tbilisi:   From which bus station in Tbilisi do buses to Baku depart? Ortachala? Didube? Is there just one bus company or several? How many buses per day? What time do the buses leave? What is the fare to Baku?


I have the following problem: I am writing a couple of algorithms using algorithm2e. I have a bunch of longer if statements and longer if conditions. The lines are broken, but the new lines are not indented properly:  \begin{document}    \begin{algorithm}[H]     \SetAlgoLined     \KwInput{Parameters...}      \KwOutput{$\emptyset$}      \If{the lines through $x_{1}, x_{2}$ and $y_{1}, y_{2}$ intersect in a single point $z$         which lies on the circle $C$        }     {       Do something \;     }     \caption{Algoritm test...}   \end{algorithm}  \end{document}   I could force line breaks at certain positions using \, but that does not fix the indentation problems either. I saw the solution provided here:   But I don't understand what is happening in that code and I was not able to reproduce the result with my problem. How can I indent the code correctly (is it possible to use something like an mbox?)?


Measurement of any qubit state in Y-basis

how can I measure any qubit state in Y-basis in qiskit. there is this solution here  but it gives the qubit's position on bloch sphere in z-axis where as I think it should be on y-axis just like in X-measurement basis (created by H,Z-measure,H) the qubit position is always on x-axis. The y-basis measurement in solution (link above) uses the initial state of |+⟩ and if we change the qubit initial state  to 0 or 1 it collapses onto z-axis whereas it should remain on y-axis , if it is correctly measuring in y-basis, right? Any guidance about how we can measure in y-basis using qiskit would be appreciated. Thanks


If light travels along null-like geodesics, does that mean it remains at the same point on a spacetime manifold?

I know my question doesn't make sense all ready. Suppose I have points $(0,0,0,0)$ and $(1,1,0,0)$. The distance traveled is zero since $ds^2 = 0$ in this case. And light has moved from one point to another. And since these two points are distinct, it has traveled on the manifold ¿presumably? along a geodesic.    But I don't quite follow what this means. How can $ds^2$ be zero and I can move somewhere? If $ds^2$ doesn't measure spacetime distance, how can I say, for instance, the sun is 0.00001581 light years away from the earth?


How can I handle SIGINT trap with a user prompt in shell script?

I am trying to handle SIGINT/CTRL+C interrupt in such a way that if a user accidentally presses ctrl-c, he is prompted with a message, "Do you wish to quit?(y/n)". If he enters yes, then exit the script. If no, then continue from where ever the interrupt occurred. Basically, I need Ctrl-C to work similar to Ctrl-Z/SINTSTP but in a slightly different way. I have tried various ways to acheieve this but I didn't get the expected results. Below are few scenario which I tried.  Case:1  Script : play.sh  #!/bin/sh function stop() { while true; do      read -rep $'\nDo you wish to stop playing?(y/n)' yn     case $yn in         [Yy]* ) echo "Thanks for playing !!!"; exit 1;;         [Nn]* ) break;;         * ) echo "Please answer (y/n)";;     esac done }  trap 'stop' SIGINT  echo "going to sleep" for i in {1..100} do   echo "$i"   sleep 3    done echo "end of sleep"   When I run the above script, I get the expected results.  Output:  $ play.sh  going to sleep 1 ^C Do you wish to stop playing?(y/n)y Thanks for playing !!!  $ play.sh  going to sleep 1 2 ^C Do you wish to stop playing?(y/n)n 3 4 ^C Do you wish to stop playing?(y/n)y Thanks for playing !!!  $     Case:2  I moved the for loop to a new script loop.sh, thus play.sh becomes the parent process and loop.sh the child process.  Script : play.sh  #!/bin/sh function stop() { while true; do      read -rep $'\nDo you wish to stop playing?(y/n)' yn     case $yn in         [Yy]* ) echo "Thanks for playing !!!"; exit 1;;         [Nn]* ) break;;         * ) echo "Please answer (y/n)";;     esac done } trap 'stop' SIGINT  loop.sh   Script : loop.sh  #!/bin/sh echo "going to sleep" for i in {1..100} do   echo "$i"   sleep 3    done echo "end of sleep"   Output in this case is not as expected.  Output:  $ play.sh  going to sleep 1 2 ^C Do you wish to stop playing?(y/n)y Thanks for playing !!!  $ play.sh  going to sleep 1 2 3 4 ^C Do you wish to stop playing?(y/n)n $   I understand that when a process receives a SIGINT signal, it propagates the signal to all the child processes, thus my 2nd case is failing. Is there any way that I can avoid SIGINT being propagated to child processes and thus make the loop.sh work exactly the way it worked in the 1st case?  Note: This is just an example of my actual application. The application I am working on has several child scripts in play.sh and loop.sh. I should make sure that the application on receiving SIGINT, should not terminate but it should prompt the user with a message.


Procedure or function ' ' expects parameter ' ' which is not supplied

I've annoyingly got what appears to be a very 'popular' error. However, in my case I'm supplying the expected parameter and it definitely has a value, so I'm stumped. Here's my code:  public static DataTable MyDataTable(string pd, bool showAll) {     DataTable results = new DataTable("PD results");      string Conn = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;      using (SqlConnection connection = new SqlConnection(Conn))     {         SqlCommand cmd = new SqlCommand("dbo.MyProcedure", connection);          SqlParameter pdParam = new SqlParameter("@i_user", SqlDbType.VarChar);         pdParam.Value = pd;         cmd.Parameters.Add(pdParam);          if (showAll)              cmd.Parameters.AddWithValue("@i_ShowALL", (int)1);         else              cmd.Parameters.AddWithValue("@i_ShowALL", (int)0);          SqlDataAdapter da = new SqlDataAdapter(cmd);          try         {             da.Fill(results);         }         catch (Exception ex)          {             string error = ex.Message;         }      }       return results; }   I've stepped through the code and the error occurs with parameter @i_user. However, when I'm adding the parameter it has a value and I confirmed this when looking at the SqlDataAdapter > SelectCommand >Parameters > Non-Public members > items > [0] {@i_user} > base > value.  Despite having the parameter supplied with a varchar value I get the error      Procedure or function 'dbo.MyProcedure' expects parameter '@i_user' which is not supplied   What am I doing wrong?


Like all tools, an SSD will wear out from use and eventually fail. Are there data on roughly how long the SSD's that Apple ships in it's portable line last?   From my research, it seems that the  that comes on Apple MacBook Pros is much slower than the others on the market, but might this have an advantage in terms of longevity?  Basically, is Apple SSD durability longer than third party drives like Crucial, OWC, or others?


How do I find the ID of an element that was clicked?

Say I have an many html elements, a row in a table composed of table data () tags.  foo	 bar	 baz	   How would I return the id of the td that was clicked. I know that I should make them links so that I can click on them properly, but just for this case I don't want to put links.  $("td").click(function () {   id = //The ID finder goes here   clickFunction(id)  }   I was thinking this is how it would be formatted. JQuery would attach an onclick event listener to any table data tags and when it fired, a function would run with the id of the table data element that was clicked.


Is "More than one teacher..." singular or plural?

I encountered a problem:  More than one teacher is/are going to bring the students to a trip.  Can you help me with this? Any help would be appreciated.


Pipe output of one command to two others

I need to pipe the output of one command to two other commands.  cat filename.txt | tail -n 1 cat filename.txt | wc -l   Since the file is huge I want to avoid reading it twice. I checked tee command but it redirects output to file which I don't want. There are many related posts but did not find anything relevant


Combining Bhattacharya Distance (or A Measure of Similarity) --- across Different Variables (Properties)

We have a series of observations of different properties (such as heart rate or blood sugar level and others as well) across different days from different people from different geographical regions. The number of days on which the observations are made is the same for all regions; but there could be different number of participants in each region. The result of the data collection will be as follows: DATA We have a matrix, $M_{i,j}$, for each region $i$ and property $j$, with $T$ observations across time (rows) and $N_{i,j}$ (columns) for number of participants from region $i$ and property $j$. Here, we consider all properties together as representing a region. OBJECTIVE The goal is to identify people from which regions have a more similar constitution. QUESTION How can we compute the Bhattacharya Distance across the various matrices $M_{i,j}$ for all the properties combined for a region (corresponding to Case 2 of the data collection)? Dimension of Matrix: $Dim(M_{i,j})=(T,N_{i,j})$ There are two cases here. 1) $N_{i,j}=N_{i,k}$ $,\forall j,k$ That is the number of participants in a region are the same for all properties being measured. 2) $N_{i,j} \neq N_{i,k}$ $,\forall j,k$ That is the number of participants in a region could be different for some of the properties being measured. But if helpful we can assume the simple case 1) $N_{i,j}=N_{i,k}$. Please let me know if anything is not clear and if you need any further information. Related Case When we have a matrix, $M_i$, for each region $i$, with $T$ observations across time (rows) and $N_i$ (columns) for number of participants from that region. Here, we consider each property separately. How can we compute the Bhattacharya Distance across the various matrices $M_i$ (in pairs or combined, whichever is simpler) separately for each property (corresponding to Case 1 of the data collection)? Answer:


short story about a man who wakes to find that time is running very slowly, but then time speeds up

I'm looking for a short story about a man who wakes (maybe on a spaceship) after some accident to find that time is running very slowly, so he believes he has all the time in the world to think about puzzles, but then time starts to speed up so he doesn't after all.


How to divide two 64-bit numbers in Linux Kernel?

Some code that rounds up the division to demonstrate (C-syntax):  #define SINT64 long long int #define SINT32 long int  SINT64 divRound(SINT64 dividend, SINT64 divisor) {   SINT32 quotient1 = dividend / divisor;    SINT32 modResult = dividend % divisor;   SINT32 multResult = modResult * 2;   SINT32 quotient2 = multResult / divisor;    SINT64 result = quotient1 + quotient2;    return ( result ); }   Now, if this were User-space we probably wouldn't even notice that our compiler is generating code for those operators (e.g. divdi3() for division). Chances are we link with libgcc without even knowing it. The problem is that Kernel-space is different (e.g. no libgcc). What to do?  Crawl Google for a while, notice that pretty much everyone addresses the unsigned variant:  #define UINT64 long long int #define UINT32 long int  UINT64 divRound(UINT64 dividend, UINT64 divisor) {   UINT32 quotient1 = dividend / divisor;    UINT32 modResult = dividend % divisor;   UINT32 multResult = modResult * 2;   UINT32 quotient2 = multResult / divisor;    UINT64 result = quotient1 + quotient2;    return ( result ); }   I know how to fix this one: Override udivdi3() and umoddi3() with do_div() from asm/div64.h. Done right? Wrong. Signed is not the same as unsigned, sdivdi3() does not simply call udivdi3(), they are separate functions for a reason.  Have you solved this problem? Do you know of a library that will help me do this? I'm really stuck so whatever you might see here that I just don't right now would be really helpful.  Thanks, Chad


Java Null Pointer Exception for int array?

Currently working on a GA for the game puzzles and dragons, and keep running into this issue where I cannot create valid individuals because I cannot create a valid child. The issue always falls back onto where the individual tries to find the positions of the 2d array and comes back a null pointer exception in the Array Traverse function.    public class Individual {    static int MoveLength = 5;   int fitness = 0;   boolean Feasibility = true;  ArrayList<Integer> Move = new ArrayList(); public int[] position = new int[2]; char[][] PuzzleMatrix;   public void GenerateIndividual(){     PositionRandomizer();     RandomMoves();     MoveFollower();    // PrintMatrix(PuzzleMatrix);     if(this.Feasibility == false){         GenerateIndividual();     }     System.out.println("sucess"); }      public Individual(char[][] PuzzleMatrix){     PuzzleMatrix = this.PuzzleMatrix; }  public void MoveFollower(){     for(int x = 0; x < Move.size(); x++){         ArrayTraverse(Move.get(x));     } }  public int randomnumbergenerator(){     int[] myArray = {0,1,2,3};     Random generator = new Random();     int randomIndex = generator.nextInt(myArray.length);     return myArray[randomIndex]; }  public void PositionRandomizer(){     /*     http://stackoverflow.com/questions/363681/generating-random-integers-in-a-specific-range     random position value     */     Random ran = new Random();     int random = ran.nextInt(7);     Random ran2 = new Random();     int random2 = ran2.nextInt(7);           position[0] = random;     position[1] = random2; }  public void RandomMoves(){     for(int x = 0; x < MoveLength; x++){         int randomMove = randomnumbergenerator();         Move.add(randomMove);     }        }  public void ArrayTraverse(int direction){     System.out.println(direction);     try{         if(direction == 0){             char original = PuzzleMatrix[position[0]][position[1]];             char newvalue = PuzzleMatrix[position[0] - 1][position[1]];             PuzzleMatrix[ position[0] - 1 ] [position[1]] = original;             PuzzleMatrix[ position[0]]     [position[1]] = newvalue;         }         if(direction == 2){             char original = PuzzleMatrix[position[0]][position[1]];             char newvalue = PuzzleMatrix[position[0] + 1][position[1]];             PuzzleMatrix[ position[0] + 1 ] [position[1]] = original;             PuzzleMatrix[ position[0]]     [position[1]] = newvalue;         }         if(direction == 1){             char original = PuzzleMatrix[position[0]][position[1]];             char newvalue = PuzzleMatrix[position[0]][position[1] + 1];             PuzzleMatrix[ position[0]] [position[1] + 1 ] = original;             PuzzleMatrix[ position[0]]     [position[1]] = newvalue;         }         if(direction == 3){             char original = PuzzleMatrix[position[0]][position[1]];             char newvalue = PuzzleMatrix[position[0]][position[1] - 1];             PuzzleMatrix[ position[0]] [position[1] - 1 ] = original;             PuzzleMatrix[ position[0]]     [position[1]] = newvalue;         }     }catch(Exception e){         System.out.println(e);         Feasibility = false;     } }  public void PrintMatrix(char[][] PuzzleMatrix){      for (int i = 0; i < PuzzleMatrix.length; i++) {         for (int j = 0; j < PuzzleMatrix[0].length; j++) {             System.out.print(PuzzleMatrix[i][j] + " ");             }         System.out.print("\n");     }  }


Why the font properties are not applied to text inside a class?

I want to apply some font property to some text inside a span element with a class  But in browsers the font properties are not applied. What to do?  I want to apply a font and some font property like size, weight to some text inside a span element which has a class named "2ndtype". But when i open it in chrome the font properties are not applied. What to do?  the html looks like this:

GOBIKES

AVAILABLE BIKES IN YOUR LOCATION
    and the CSS is:  .2ndtype {     font-family: Candara;     font-size: 27px;     font-weight: bold;  }   but in browsers i only get default html font and size applied to the text  "AVAILABLE BIKES IN YOUR LOCATION".


Finder windows just show screen artefacts

On our Macbook Air (Mid-2011 11", OS X 10.9.5 Mavericks), starting a few days ago, every time we open Finder windows, the right side just shows screen artifacts/cheese. File Open dialogs in MS Word work fine - it is just the Finder windows with the problem.  Can someone help?  I have tried rebooting, and Verify Disk in Disk Utility. Neither helped. Maybe I should upgrade to El Capitan? But why would this start happening all of a sudden?


Countable set of number rational, prove with $\mathbb{Z}$.

Good morning, I need to prove $ \mathbb{Q} $ is a countable set, but I prove $ \mathbb{Z} $ is a countable set, now, can I use this for proving $ \mathbb{Q} $ is countable set? I was thinking about a bijective function with $ \mathbb{Z} $ and $ \mathbb{Q} $ for say $ \mathbb{Q} $ is countable set.


Separate clipboard for particular application

Is it possible, on Debian with Klipper running, to have a separate "clipboard stack" for a particular application?  I'd like the text that I copy in application Y not to be shared with all the other applications running.  All the solutions mentioned at  seems like overkill.


A causative construction is used, for instance, when we have / make / ... someone do something for us. For example,   "I had the painter paint my house".  We could render this passively too:   "I had my house painted",   meaning that I arranged for a painter to come and paint my house. Or another example:   "I had my car fixed",  meaning that I did not fix my own car rather I asked someone to fix it for me.   But sometimes, we use the exact same construction, that is, "have/get + object + past participle", to denote that we have performed something:  "I got my homework done" or   "I need to get this done by tomorrow".   I am confused! How can one determine when the construction is causative and when it is not?


passing a pointer to a class method as a function argument

I have a class  class A{     A(/*constructor arguments*/);     double MethA(double); };   And I want to pass the method MethA in a function that takes a pointer to a function :  double function(double (*f)(double), double x){     return f(x); }   So  what I'm doing is to call  A a(/*constructor arguments*/); function(a.MethA,1.0);   but it doesn't compile.  I'm pretty sure that this question is answered somewhere else, but I couldn't find where because I'm not sure that the terminology I use is correct. Am I trying to pass a pointer on a class method as a function argument ? Or, to pass a function pointer as a member of a class... I'm confused :-(


Can I suggest the authors to hire professional writer for scientific paper as a reviewer during second review?

I have reviewed a scientific paper and suggested a major revision. They corrected it but still, I think the language quality is not standard. In this case, can I ask the authors to hire a professional writer? Is it ok if I ask them now because this is the 2nd review? Or I just ask the editor if he can suggest the authors hire a professional writer?


Vector Geoprocessing Tools Missing from QGIS 2.18.2 for Mac OSX 10.11.6

I tried the steps from .   Most of the tools under "Vector" are missing from my recent installation of QGIS 2.18.2, so I am unable to clip, buffer, make Voronoi polygons, etc. Python appears to be running correctly and I have checked to ensure my plugins are updated and enabled. For some reason "ftools" plugin is not availabe when I search for it in Plugin Manager under "All".  EDIT: I did a clean reinstall of QGIS and this fixed the problem. I think there was an old version of GDAL causing the problem.


Theorem : For every natural number $p$: $$\sum^p_{i=0} 2^i = 2^{p+1}-1$$ I trieed to demonstrate the theorem using induction  Demonstration :  $1)$ If we have $p=0$ then we get $2^0=2^{0+1}-1$ that is always true. $2)$ Supposing that the first statement is true then we get that $$\sum^{p+1}_{i=0} 2^i = 2^{p+2}-1$$ Now we know that: $$\sum^{p+1}_{i=0} 2^i - \sum^p_{i=0} 2^i = 2^{p+1}$$ and if that is true, must be also true that: $$2^{p+2}-1-(2^{p+1}-1) = 2^{p+1}$$ $$2^{p+2}-1-(2^{p+1}-1)=2^{p+2}-2^{p+1}=2^{p+1}(2^1-2^0)=2^{p+1}$$ QED  Is this a valid demonstration?


What is happening here, when I use squared loss in logistic regression setting?

I am trying to use squared loss to do binary classification on a toy data set. I am using mtcars data set, use mile per gallon and weight to predict transmission type. The plot below shows the two types of transmission type data in different colors, and decision boundary generated by different loss function. The squared loss is $\sum_i (y_i-p_i)^2$ where $y_i$ is the ground truth label (0 or 1) and $p_i$ is the predicted probability $p_i=\text{Logit}^{-1}(\beta^Tx_i)$. In other words, I am replace logistic loss with squared loss in classification setting, other parts are the same. For a toy example with mtcars data, in many cases, I got a model "similar" to logistic regression (see following figure, with random seed 0).  But in somethings (if we do set.seed(1)), squared loss seems not working well.  What is happening here? The optimization does not converge? Logistic loss is easier to optimize comparing to squared loss? Any help would be appreciated.  Code d=mtcars[,c("am","mpg","wt")] plot(d$mpg,d$wt,col=factor(d$am)) lg_fit=glm(am~.,d, family = binomial()) abline(-lg_fit$coefficients[1]/lg_fit$coefficients[3],        -lg_fit$coefficients[2]/lg_fit$coefficients[3]) grid()  # sq loss lossSqOnBinary<-function(x,y,w){   p=plogis(x %*% w)   return(sum((y-p)^2)) }  # this random seed is important for reproducing the problem set.seed(0)  x0=runif(3) x=as.matrix(cbind(1,d[,2:3])) y=d$am opt=optim(x0, lossSqOnBinary, method="BFGS", x=x,y=y)  abline(-opt$par[1]/opt$par[3],        -opt$par[2]/opt$par[3], lty=2) legend(25,5,c("logisitc loss","squared loss"), lty=c(1,2))


I imagine this is a classic floating point precision question, but I am trying to wrap my head around this result, running 1//0.01 in Python 3.7.5 yields 99.   I imagine it is an expected result, but is there any way to decide when it is safer to use int(1/f) rather than 1//f ?


What is delaying the rollout of the new top bar to other Stack Exchange sites?

In , we were advised that the new top bar navigation on Stack Overflow would be rolled out to all of the other Stack Exchange sites (fixing the annoyance that site switching moves from right > left).   But that was 6 months ago. Is there anything specific causing the delay? Just curious.


Can someone help me with this assignment:  Let $\Re z <0$. Prove that $z_n=(1+z) \left(1+\frac{z}{2} \right) ... \left( 1+ \frac{z}{n} \right) \to 0$.  I was trying to look for a sequence $a_n$ which goes to $0$ as $n$ goes to $\infty$ such that  $|z_n|^2 \le a_n$ but I've failed...


How does a stock trade at an exchange that isn’t where it is listed?

For example, AAPL is listed on NASDAQ but I see that NYSE has some trading volume for that symbol. Does NYSE just act as the matching engine, fill the orders, and then report the trades to the listing exchange?


Take a particle, it has a position $(x, y, z)$ maybe it is $(0.231, 8.962, 10.567)$.  Is there a maximum precision to this? Is the space discrete or continuous? If it is discrete, how thin the measurement is between a point A and B in space?


Is there a native js way to extend an object such that the original object is modified?  eg  const obj = {a: 1} const obj2 = {b: "bar"}   such that obj returns {a:1, b: "bar"}. Or is this impossible and an new object has to be created?


How can I increase the tx power of my wifi adapter? I want to increase it more than the limit (15)


preservation of completeness under homeomorphism

Does homeomorphic metric spaces preserves completeness?I mean two metric space which are homeomorphic and one of them is complete$\Rightarrow$ another one is also complete?


String of Hexadecimal characters compression to a smaller string

I have this String c9e9a0f30c56fc4881f09b65070ecf6ad65f2a51bc910fd5 composed of hexadecimal characters only. Correct me if I'm wrong but a character on a String takes a byte for its representation right? But since a hexadecimal character fits in 4 bits I could fit two characters in a byte. Is there a simple way to do this in Java?  Thank you in advance! You guys rock!


<?php   $pattern = "/http:\\/\\/(([A-Za-z0-9.\-])*)/";   $text = "http://www.google.com";   $text = preg_replace($pattern,"\\0",$text);   echo $text;  ?>   The code above gets the URL from a string variable and adds an HTML tag           for a link. So "http://www.google.com" becomes "http://www.google.com".  My question is how "\0" is something like placeholder for the value of the parameter "$text" in the "preg_repace" function, after it means NULL or 0x0?


In the year 2020, why do we still get prompted to restart our computer after installing software?

Did it ever really make a difference? I haven't restarted after an install in nearly 15 years if I'm honest. What have I been missing out on? Keep in mind I mean simple software, not huge drivers, operating system updates, or major downloads like that.


zip() and zip(*) seem to give similar results

I'm trying to understand the difference between zip() and zip(*).  From what I understand, zip() can be used to combine two lists, such that elements with a shared index are together. Such as in these examples:  dict_list = {'First Name': ['Tom', 'Ann', 'Ben'],              'Last Name': ['Haverford', 'Perkins', 'Wyatt'],              'Age': [33, 42, 44],              'Occupation': ['Administrator', 'Nurse', 'Auditor']}  for first_name, last_name, age, occupation in zip(dict_list['First Name'], dict_list['Last Name'], dict_list['Age'], dict_list['Occupation']):              print(first_name, last_name, age, occupation)  #result      Tom Haverford 33 Administrator Ann Perkins 42 Nurse Ben Wyatt 44 Auditor   So why does it seem to me that sometimes, zip(*) behaves this way? For example:  for t in (zip(*dict_list.values())):     print(t) #result      ('Tom', 'Haverford', 33, 'Administrator') ('Ann', 'Perkins', 42, 'Nurse') ('Ben', 'Wyatt', 44, 'Auditor')   Since my dict_list.values() are lists, it seems like zip(*) placed all elements with shared indexes in the same tuple. Which is not that much different from the first code, in which I used zip() in a for loop with dict keys passed into it and with corresponding looping variables  How are zip() and zip(*) behaving in this case?


I have two "identical" files that I compare in diff, and it shows that every line is different, after looking at the file I found that one of them has ^M at the end of every line. How do I remove this? I tried this sed command:  sed -i '' -E 's/^M//g'   this tr command: (which even if it worked I wouldn't want since I want to do in place editing)  tr -d '^M'   and this perl command:  perl -pi -e 's/^M//g'   But none of those changed the contents.


Prove $n-m \mid n^r - m^r\,$ [Factor Theorem, monomial case]

In respect to a larger proof I need to prove that $(n-m) \mid (n^r - m^r) $ (where $\mid$ means divides, i.e., $a \mid b$ means that $b$ modulus $a$ = $0$). I have played around with this for a while now but to no avail and would be grateful if you could help me.


What's the best counter strategy against battlecruisers?

How should I prepare my army when attacking someone who has 12+ battlecruisers? (Protoss/Zerg/Terran answers are more than appreciated)


Getting a null pointer exception on this line of code. What is a null pointer? And how do i fix

if (methodCall.getClassName(cg.getConstantPool()).contains(ALLATORI_CLASS.getClassName())) {   Im trying to fix a java application, and I keep getting a null pointer exception. What is it exactly? And how would I go about fixing this line of code?


Chat is down. Where can I find when it'll be back up?

Chat is down network-wide. Where can I find when it'll be back up?


I want to make an environment for my tables. See the following example:  \documentclass[a4paper,10pt]{scrartcl}  \usepackage{longtable} \usepackage{booktabs}           % \toprule, \bottomrule \usepackage{tabu}  \begin{document}    \newenvironment{kpTable}   {     \begin{longtabu}{X[1,c] X[1,c]}         \toprule \rowfont{\bfseries}         Foo & Bar\\         \midrule         \everyrow{\tabucline[on 3 pt off 3pt]-}   }   {         \everyrow{}\\         \bottomrule         \caption{}  % ERROR: Missing number, treated as zero.     \end{longtabu}   }    \begin{kpTable}     1 & 2 \\     1 & 2 \\     1 & 2   \end{kpTable}  \end{document}     The caption statement generates the error: "Missing number, treated as zero.  \tabu@0.H6"  How can I fix?


PostgreSQL CPU 100% after configure Wal log shipping hot standby

I have configured Hight Avaliabily WAL Log Shipping Hot Standby (SSL) with one node. But after I configure, both hosts (primary and secondary) take 100% CPU usage. The most strange is because I have only one database called "TESTE" with one table called "EXAMPLE" to check if replication was OK. The replication worked perfectly but I don't understand why my CPU takes 100% usage because I don't have any application connect on my cluster. I ran HTOP command and get this results: Image 1 - Primary Server HTOP Info  Image 2 - Secondary Server HTOP info  S.O. version: No LSB modules are available. Distributor ID: Debian Description:    Debian GNU/Linux 10 (buster) Release:        10 Codename:       buster  PostgreSQL version: postgres (PostgreSQL) 12.3 (Debian 12.3-1.pgdg100+1)  Primary server postgres.conf file: max_connections = 100 SSL = on shared_buffers = 2GB work_mem = 10485kb maintenance_work_mem = 512MB dynamic_shared_memory_type = posix effective_io_concurrency = 200 max_worker_processes = 4 max_parallel_maintenance_workers = 2 max_parallel_workers_per_gather = 2 max_parallel_workers = 4 wal_level = replica wal_buffers = 16MB max_wal_size = 200MB min_wal_size = 80MB checkpoint_completion_target = 0.7 archive_mode = on max_wal_senders = 3 wal_keep_segments = 8 hot_standby = on hot_standby_feedback = on random_page_cost = 1.1 effective_cache_size = 6GB default_statistics_target = 100  pg_stat_activity info:  pg_stat_archiver info:  pg_stat_replication info:  If I stop postgres service in both servers the CPU still has 100% usage. Anyone can help me?


could someone please explain to me the following question:  Let $f,g$ be continuous functions from $\mathbb{R}$ to $\mathbb{R}$ and suppose that $f(r) = g(r)$ for all $r \in \mathbb{Q}$. Is it true that $f(x) = g(x)$ for all $x \in \mathbb{R}$?  My claim is that it should be true since $f$ and $g$ are continuous from $\mathbb{R}$ to $\mathbb{R}$, so if $f(x) \neq g(x)$ for all $x \in \mathbb{R}$ then it cant be continuous on $\mathbb{R}$?   So, is my claim correct and if it is how am I supposed to prove it (please give me some hints) Also, if my claim is wrong, could you please explain to me as to why its wrong`


Adding Transparent Polygon to Map using ArcObjects?

I am creating an ArcGIS Desktop Add-In that allows the user to draw a polygon and then have it added to the map. I am able to capture the polygon and add it to the map, the issue is the transparency. Currently and by default it is 100% opacity and solid. I want to make it around 50% opacity so the user can see the data behind it.   Here is the ArcObjects 10.3 code I have so far:       public static void AddPolygonToMap(IActiveView ActiveViewInstance, IGeometry NewGeo)     {         //Local Variable Declaration         var fillShapeElement = default(IFillShapeElement);         var element = default(IElement);         var graphicsContainer = default(IGraphicsContainer);         var simpleFilleSymbol = default(ISimpleFillSymbol);         var newRgbColor = default(IRgbColor);         var lineSymbol = default(ILineSymbol);          //Use the IElement interface to set the Envelope Element's geo         element = new PolygonElement();         element.Geometry = NewGeo;          //QI for the IFillShapeElement interface so that the symbol property can be set         fillShapeElement = element as IFillShapeElement;          //Create a new fill symbol         simpleFilleSymbol = new SimpleFillSymbol();          //Create a new color marker symbol of the color black;         newRgbColor = new RgbColor();         newRgbColor.Red = 0;         newRgbColor.Green = 0;         newRgbColor.Blue = 0;          //Create a new line symbol so that we can set the width outline         lineSymbol = new SimpleLineSymbol();         lineSymbol.Color = newRgbColor;         lineSymbol.Width = 2;          //Setup the Simple Fill Symbol         simpleFilleSymbol.Color = newRgbColor;         simpleFilleSymbol.Style = esriSimpleFillStyle.esriSFSHollow;         simpleFilleSymbol.Outline = lineSymbol;         fillShapeElement.Symbol = simpleFilleSymbol;          //QI for the graphics container from the active view allows access to basic graphics layer         graphicsContainer = ActiveViewInstance as IGraphicsContainer;          //Add the new element at Z order 0         graphicsContainer.AddElement((IElement)fillShapeElement, 0);          //Show the new graphic         ActiveViewInstance.Refresh();     }


The first time I installed LaTeX was in /usr/share/texmf-texlive (~600MB). Yesterday I installed TeX Live from apt-get, I simply don't know where it has been installed (~1GB). Today I installed Tex Live from  (~4.5GB). It's in /usr/local/texlive/2013. However both Kyle and TeXMaker are still using the first installation.  How can I choose which version to use?


In our lecture today we took this identity: $ \vec p \times e\vec A = -e \vec A \times \vec p +(\hbar/i)e (\nabla\times \vec A) $ which the professor, couldn't bother explaining. I understand the first part but i cannot understand the 2nd part. Can anyone explain to me how this hold true?


Is there any difference between being ill and sick?

I can say I'm ill or I'm sick. But what is the difference between the usage of these terms?  I've heard that one can use sick for longer-term and ill for shorter-term, but is that really correct? How are these terms different for native speakers?


Why doesn't the "Disable for viewport selection" button doesn't show up in the Outliner?

I can't lock my reference image because there is no visible button for disabling the image to be editable:


What happened to Lucius Malfoy and Narcissa after the war?

At the end of the Deathly Hallows part 2,Draco and Astoria are seen dropping their son off at platform 9 3/4. Lucius Malfoy never played an active role in the final battle though it's pretty clear he and his wife were death eaters. What happened to them at the end of the series? Did they go to Azkaban or were they let free because Narcissa lied for Harry?


Too little space between wrapped text and the line below it

Consider the following table example, the text in the second row is wrapped.  \documentclass[a4paper]{article}  \usepackage[english]{babel} \usepackage[utf8x]{inputenc} \usepackage{tabu} \usepackage{booktabs}  \usepackage{array} \setlength{\extrarowheight}{5pt}  \begin{document}    \begin{tabu} to \linewidth {X[.5,c] X[1,l] X[1,l] X[2,l]}     \toprule     \rowfont{\bfseries}     Row & Head 1                   & Head 2 & Head 3 \\\hline     1.  & short text               & ? & ? \\\hline     2.  & long long long long text & ? & ? \\\hline     3.  & short text               & ? & ? \\\hline     4.  & short text               & ? & ? \\     \bottomrule   \end{tabu}  \end{document}   It renders like:    Why is there so little space between the text in the second row and the rule below it?  How can I fix it?  What comes to my mind is to use \\[1ex] instead of \\, is there a better solution?


Does python list(set(a)) change its order every time?

I have a list of 5 million string elements, which are stored as a pickle object.  a = ['https://en.wikipedia.org/wiki/Data_structure','https://en.wikipedia.org/wiki/Data_mining','https://en.wikipedia.org/wiki/Statistical_learning_theory','https://en.wikipedia.org/wiki/Machine_learning','https://en.wikipedia.org/wiki/Computer_science','https://en.wikipedia.org/wiki/Information_theory','https://en.wikipedia.org/wiki/Statistics','https://en.wikipedia.org/wiki/Mathematics','https://en.wikipedia.org/wiki/Signal_processing','https://en.wikipedia.org/wiki/Sorting_algorithm','https://en.wikipedia.org/wiki/Data_structure','https://en.wikipedia.org/wiki/Quicksort','https://en.wikipedia.org/wiki/Merge_sort','https://en.wikipedia.org/wiki/Heapsort','https://en.wikipedia.org/wiki/Insertion_sort','https://en.wikipedia.org/wiki/Introsort','https://en.wikipedia.org/wiki/Selection_sort','https://en.wikipedia.org/wiki/Timsort','https://en.wikipedia.org/wiki/Cubesort','https://en.wikipedia.org/wiki/Shellsort']   To remove duplicates, I use set(a), then I made it a list again through list(set(a)).   My question is:  Even if I restart python, and read the list from the pickle file, will the order of list(set(a)) be the same every time?  I'm eager to know how this hash -> list ordering works.     I tested with a small dataset and it seems to have a consistent ordering.  In [50]: a = ['x','y','z','k']  In [51]: a ['x', 'y', 'z', 'k']  In [52]: list(set(a)) ['y', 'x', 'k', 'z']  In [53]: b=list(set(a))  In [54]: list(set(b)) ['y', 'x', 'k', 'z']  In [55]: del b  In [56]: b=list(set(a))  In [57]: b ['y', 'x', 'k', 'z']


I have enough memory but I can't install anything!

When I try to install an app that is 13 mb it is downloaded but when the part of the installation comes it can't be installed it says I don't have enough space. I tried downloading the apk file of that application and still I downloaded it successfuly and I couldn't install it because it said i don't have enough memory even if I have 250mb. I am using Lg L Fino and It is rooted. Please help if you know how. I appreciate all of your answers and I will give you more infromations if needed. Thanks in advance!


Find all the positive integers (x,y), such that  a) $1!+2!+3!+\cdots+ x!=y^2$  b)$1!+2!+3!+\cdots+x!=y^z$


I have windows 8 installed. I want to remove it completely and install Linux first. Then later I might need to install Windows 7 as well.  I'm installing Linux from a bootable USB right now. If I choose "Remove Windows 8 completely and install Linux instead of it" in a dialog and take all the space of my disk for Linux (ext4), will I be able to "take a part of it back" later (when I want to install Windows), format it into ntfs and install Windows 7 there along with Linux?


Invalid date field, BibLaTeX produces no output

This is an MWE to reproduce the same effect, as I encountered on a larger BibLaTeX database. The database was created in beginning of 2019 and used since then on a regular basis (twice a year).  I can't remember having problems like that. As you can see, the date entries are as described in the BibLaTeX manual, section 2.3.8, in YYYY-MM-DD, enclosed in either curly braces or quotes, followed by the comma. Here is the MWE including the BibLaTeX file with two entries: \documentclass[10pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} \usepackage{csquotes} \usepackage[backend=biber,style=numeric]{biblatex}  \newcommand{\TeXLive}{\TeX{}Live}  \begin{filecontents}{\jobname-2.bib} @Manual{texlive-de-2020,   editor =   {Berry, Karl},   title =    {Anleitung zur \TeXLive-Installation},   date =     {2020-03-28},   subtitle =     {Version 2020},   langid =       {ngerman},   translator =   {Dr. Ziegenhagen, Uwe},   pagetotal =    96,   langid =   {ngerman},   keywords =     {manual},   note =     {Bestandteil der Online-Dokumentation von \TeXLive,                   Datei \texttt{texlive-de.pdf}} }   @article{worland_renewable_2015,   title =    {The {Renewable} {Energy} {Source} {That}'s {About}                   to {Boom} {Again}},   issn =     {0040-781X},   url =      {http://time.com/3978215/hydropower-us-growth/},   abstract =     {'Whether we like it or not, over the next 20 years                   roughly the world will double its hydropower                   capacity'},   urldate =  "2016-12-07",   journal =  {Time},   author =   {Worland, Justin},   month =    jul,   year =     2015,   keywords =     {energy outlook, energy production in the u.s.,                   Hydropower, u.s. energy, u.s. energy production}, } \end{filecontents}  \addbibresource{\jobname-2.bib}  \begin{document} % \cite{texlive-de-2020} \nocite{*} \printbibliography{} \end{document}  After running latex I call biber and get this messages Running `Biber' on `test' with ``biber test'' INFO - This is Biber 2.15 INFO - Logfile is 'test.blg' INFO - Reading 'test.bcf' INFO - Using all citekeys in bib section 0 INFO - Processing section 0 INFO - Looking for bibtex format file 'test-2.bib' for section 0 INFO - LaTeX decoding ... INFO - Found BibTeX data source 'test-2.bib' WARN - Entry 'texlive-de-2020' (test-2.bib): Invalid format '2020-03-28' of date field 'date' - ignoring WARN - Entry 'worland_renewable_2015' (test-2.bib): Invalid format '2016-12-07' of date field 'urldate' - ignoring  The next latex run will complain about the empty bibliography file LaTeX Warning: Empty bibliography on input line 49.  I can't see any error in my BibLaTeX files.  I think they are fine.  What is going wrong?


I recently graduated graduate school and am looking for a proof on R squared.  Specifically when to not use it.  I really remember a professor impressing upon me multiple times not to report R squared due to the fact it is unreliable.  I did a proof on the matter, I just do not remember it.  I've looked all over the internet, and can not seem to remember the solution.  Of course do not use R square when the data is non-linear.  And do not add variables in order to increase R square.  Here are some links to back me up:   Specifically section 3.1 #6   Do not use R sq for non-linear regression


Movie from the 80s about a guy who becomes invincible

I'm looking for the title of the movie I've seen on a bad quality pirate vhs in Hungary, in 1986 or 87. It was in color, and probably recent stuff then, but not sure.  It's about a man who gets invincible. Any wound he gets heals completely in seconds.  In the beginning there is some scene with the space shuttle. Later there's a helicopter following a train. The train enters a tunnel, but doesn't exit the other end. The helicopter descends at the tunnel entrance, and the tunnel is empty, the train has disappeared. At the end the main character drives a truck off a high cliff, into water, but reemerges unharmed.


Indian passport holder: transferring through Istanbul SAW airport -two different tickets and with baggage. Do I need a Transit Visa?

Arriving Istanbul SAW airport on an international flight with baggage and then departing in 5-6 hrs by another International airline to another country.  Do I need to go through passport control and immigration to retrieve my baggage from the conveyor belt?  Do I need to procure a Transit Visa for the same?


NullPointerException - Trouble with an array of strings

I am having a problem with a getter like :      String[] T2;     T2=Ti.getT();   Where getT() is :      public class MyClass {          public final String[] T=new String[3];          MyClass(){             this.T[0]="...";            this.T[1]="...";            this.T[2]="...";          }          public String[] getT() {             return T;         }       }   I am getting the message java.lang.NullPointerException in the  T2=Ti.getT(); line.  Can anyone give me a clue? Am I using the array correctly?  Thank you.


What does it mean for a QFT to not be well-defined?

It is usually said that QED, for instance, is not a well-defined QFT. It has to be embedded or completed in order to make it consistent. Most of these arguments amount to using the renormalization group to extrapolate the coupling up to a huge scale, where it formally becomes infinite.  First of all, it seems bizarre to me to use the renormalization group to increase resolution (go to higher energies). The smearing in the RG procedure is irreversible, and the RG doesn't know about the non-universal parts of the theory which should be important at higher energies.   I have read in a note by Weinberg that Kallen was able to show that QED was sick using the spectral representation of the propagator. Essentially, he evaluated a small part of the spectral density and showed that it violated the inequalities for the field strength $Z$ that are imposed by unitarity + Lorentz invariance, but I do not have the reference.  So what I would like to know is :   What does it take to actually establish that a QFT is not well-defined?   In other words, if I write down some arbitrary Lagrangian, what test should I do to determine if the theory actually exists. Are asymptotically free theories the only well-defined ones?   My initial thought was: We would like to obtain QED (or some other ill-defined theory) using the RG on a deformation of some UV CFT. Perhaps there is no CFT with the correct operator content so that we obtain QED from the RG flow. However, I don't really know how to make that precise.   Any help is appreciated.


"cd" into directory containg space in name

So I have been using Ubuntu for a few months now, and have come across a very noob terminal question.  I want to go from home -> Documents -> My Programs  I am able to get into my documents folder by doing  cd ./Documents   But when I want to go into "My Programs", I am unable to do so because of the space between "My" and "Programs". Is there a different syntax I must use to access this folder via terminal?


How to Add Time stamp when using ffmpeg Video Recorder?

Is there any option , that let a user record a video with a time stamp .  I use many web-cam recording and i didn't found this option .  Program i used Guvcview , Cheese .  Any Help ?


Calculating the value given by an infinite converging series

$0<p<1$   $\sum_{k=1}^{\infty} k (1 - p)^{k-1}$  How'd I go by calculating this?


Ampscript / CONTAINS and BEGIN WITH functions

What should be the syntax in AMPSCRIPT for:  %%[IF @variable CONTAINS "xxx" THEN]%% %%=ContentBlockByID("83290")=%%  and   %%[IF @variable BEGINS WITH "xxx" THEN]%% %%=ContentBlockByID("83290")=%%   ?   Is there any simple syntax ?  Would you have some examples ? I found some stuff about it on forum but it is not very clear to me.


When I vote on a question or answer in the Android app, sometimes the up arrow turns red briefly then the screen flashes ad if it refreshed and the up button is no longer red. The vote count is at its new incremented value and I get an "already voted" type message if I click the arrow button again, so I know my vote registered.   App Version: 1.0.85 Device Manufacturer: LGE Device Model: VS425PP OS Version: 5.1.1 (161331805d4f5)


I want to create an abstract rendering of lots of cubes floating in the sky. It would be good if they could also be clustered together. I'm thinking of something sort of like this:    Does Blender have any tools for placing clusters of objects, and randomly scaling them? What's the best process to do this?


How exactly do I chain fish in Pokemon X and Y? Do i have to talk to the super rod fisherman, or what. I fish every time after the last, but I have no way to know if it is working or not. I run at the end of every battle instead of KO'ing due to limited PP.


Python/Cython: Adding dynamically attribute to a class based on names in a text file

I have some extern c library that need to be used under python environment. So I came across a language called Cython and start to use it. Here is the cython module to use my extern c functions box.pyx cdef class cSignal:     cdef void *addr      def __cinit__(self, char *path):         cfun_getAddr(path, <char **>&(self.addr))          def __call__(self,*arg):         if len(arg) < 1:             return self.read()         else:             self.write(arg[0])      def read(self):         cdef double val         cfun_read(addr,&val)         return val          def write(self, double val):         cfun_write(addr,val)      class Signal(cSignal):     pass  cdef class cPage:     pass  class Page(cPage):     pass  I mange to build this .pyx as a python module and can be imported in python Now I can use another setup.py script to create many instances of Signal class and the names can be based on strings (they will be obtained from text files) import box  pagenamefromfile = ['pageA', 'pageB', ..., 'pageZ'] namefromfile = ['signalA', 'signalB', ..., 'signalZ'] pathfromfile = ['pathA', 'pathB', ..., 'pathZ'] globals()[stringfromfile[0]] = box.Signal(pathfromfile[0]) globals()[stringfromfile[1]] = box.Signal(pathfromfile[1])  After I run my setup.py, I can call them and use them in python like this: x = signalA.read() signalA.write(1)  Question: how can I do something like this (below code doesn't work) import box  globals()[pagenamefromfile[0]].globals()[stringfromfile[0]] = box.Signal(pathfromfile[0]) globals()[pagenamefromfile[0]].globals()[stringfromfile[1]] = box.Signal(pathfromfile[1])  globals()[pagenamefromfile[1]].globals()[stringfromfile[2]] = box.Signal(pathfromfile[2]) globals()[pagenamefromfile[1]].globals()[stringfromfile[3]] = box.Signal(pathfromfile[3])   in such a way that after I call my setup.py, I can do this: x = pageA.signalA() pageA.signalA(1) pageB.signalC(2) y = pageB.signalD  the page class for me it is to organize in a better way, so far I don't need any function inside.


How to get the list of all the users whose profile has changed?

I have a requirement that i want to fetch the list of all the users whose profile has changed from object user.  Say I've 3 users in my user obejct.I wrote the following code, in which I have craeted a list and put all users.But how to check which user's profile is changed and assign it in a collection?  Following is my code:  trigger UserProfileTrigger on User (before update) {      List<user> usr = [SELECT Id,Name,Username,ProfileId FROM User];     System.debug('***SFDC: User Details: ' + usr );      for (User u: usr){        System.debug('***SFDC: User is: '+u);         how to write logic for comparing new and old value of profileid for each user? }


is a light side power that many Jedi, including  are capable of. In Episode I, Qui-Gon uses it twice (once to outrun droids and once on Jar Jar's tongue), Obi-Wan uses it once and Anakin uses high speed reflexes for the entire duration of the pod race with no formal training.  According to  the power has a high drain and requires a longer recovery period than other powers. And then of course there are hilarious drawbacks such as .  But why wasn't this power used in the following scenarios (and many, many others):   The Redshirt Jedi who accompanied Windu to arrest Palpatine, before they were summarily dispatched to the Nether. Qui-Gonn, to avoid a lightsaber through his gut. Yoda, to avoid flying senate seats. By Windu, who is supposedly a notable practitioner.


Is there any physics that cannot be expressed in terms of Lagrange equations?

A lot of physics, such as classical mechanics, General Relativity, Quantum Mechanics etc can be expressed in terms of Lagrangian Mechanics and Hamiltonian Principles. But sometimes I just can't help wonder whether is it ever possible (in the future, maybe) to discover a physical law that can't be expressed in terms of Lagrangian Equations?  Or to put it in other words, can we list down for all the physical laws that can be expressed in terms of Lagrangian equations, what are the mathematical characteristics of them( such as it must not contain derivatives higher than 2, all the solutions must be linear etc)?


Retrieving Email Contents in Journey Builder

I am currently working on a journey builder that sends emails and writes back to EmailMessage Object in Sales Cloud. I have the EmailMessage created but I want to write the email html body to that EmailMessage record, is there a way I can access the email contents that was sent out in the journey builder OR in the automation studio?


Email-to-Case & Assignment Rules - Which Address Received the Email?

I received an email from Client@Example.com.  In conjunction with the Email-to-Case function, our Assignment Rules and Round-Robin Apex code dictate that when email is sent to our company using MyMailQueue@myCompany.com, create a case and assign that case to a queue called MyMailQueue.   Other than stepping through the assignment rules and Apex code, is there another way to see that the case was created because mail was sent to the address above?   In other words, I'm looking for a way to see that the email address above is definitely the one that was used because we use several different email addresses in Email-to-Case.


Select repeated sequence of an number in an array?

Given an array of numbers, how can I select the number in the array that's has been repeated the most times?  arr = [4,3, 3, 2, 1, 3, 3, 3, 4, 4, 4, 4, 0, 0, 0, 1, 3, 4, 0]


Why is the t-test designed for small samples?

I've read somewhere that the t-test is designed for small samples, why is that the case? What if I use a big sample out of a population to conduct the t-test? Would that be an issue or have potential implications?


How to switch off automatic kernel updates?

Now Nvidia with Optimus and glfrx and Bumblebee works fine here.  I want to stay with kernel 3.5.0.22 and not being automatically updated again.  How do I switch off automatic kernel updates?


Setting ImageIcon for Java application in Netbeans returns NullPointerException

I'm trying to set the ImageIcon for a java application, but when I try to obtain the resource I receive a NullPointerException.  This is the directory structure inside of Netbeans:   project-name   resources -images icon.png src target    Here is the code I'm using to set the ImageIcon:  protected ImageIcon createImageIcon(String path, String description) {     java.net.URL imgURL = getClass().getResource(path);     if (imgURL != null) {         return new ImageIcon(imgURL, description);     } else {         LOG.error("Couldn't find file: " + path);         return null;     } }   I've inserted the following custom code for the iconImage property in Netbeans:  Form.setIconImage(createImageIcon("/project-name/resources/images/icon.png", "Icon Description").getImage());   Any help is greatly appreciated.


Execute shell command and retrieve stdout in Python

In Perl, if I want to execute a shell command such as foo, I'll do this:   #!/usr/bin/perl $stdout = `foo`   In Python I found this very complex solution:   #!/usr/bin/python import subprocess p = subprocess.Popen('foo', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout = p.stdout.readlines() retval = p.wait()   Is there any better solution ?   Notice that I don't want to use call or os.system. I would like to place stdout on a variable


Why does an argument similiar to 0.999...=1 show 999...=-1?

I accept that two numbers can have the same supremum depending on how you generate a decimal representation. So $2.4999\ldots = 2.5$ etc. Can anyone point me to resources that would explain what the below argument that shows $999\ldots = -1$ is about? Here is the most usual proof I see that $0.999\ldots = 1$:  $x=0.999\ldots$ $10x=9.999\ldots$ $10x - x = 9$ $x=1$  Using this same argument template I can show $999\ldots=-1$:  $x= \ldots9999.0 $ $0.1x= \ldots9999.9$ $0.1x - x = 0.9$ $x=-1$  What might this mean? Edit from one of the comments: $$\sum_{k=0}^{\infty}{9 \cdot 10^k}=-1$$


Compare Actual table with @TypeTable_TVP IF Duplicate Row Exist

I want to compare Actual table with @TableType_TVP IF Duplicate Row Exist  Create procedure sp_InsertintoTable @TableType_TVP TableType_TVP READONLY AS   IF(Duplicate Row not Exist then)  Begin       INSERT INTO ActualTable      Select * from @TableType_TVP        Select Inserted row count also   END else    Begin          Count Duplicate Row   End


How do you sort an array based on how you sorted another array

I need to to sort an array based on how I sorted a different array, here are 2 example arrays that I have that are linked based on their indexes (so $array1[0] and $array2[0] are relevant to eachother): $array1 = Array (     '2',     '1',     '3' );  $array2 = Array (     'linked_to_2',     'linked_to_1',     'linked_to_3', );  As you can see $array1[0] is related to $array2[0], $array1[1] to $array2[1] and $array1[2] to $array2[2]. Now I create a new that uses the same values $array1 has but ordered like this: $sorted_array1 = Array (     '1',     '2',     '3' );  But I can't sort $array2 using the same method so how do I use $array1 and/or $sorted_array1 to create a sorted array using the values of $array2 like this: $sorted_array2 = Array (     'linked_to_1',     'linked_to_2',     'linked_to_3', );  For a bit of context in my actual use case I have a couple of ID's in the 1st array that I query against a database and in that database table with these ID's I order them by date of creation (which is another row in that db table). The values of array2 are not in this database table and can therefore not be sorted the same way.


Are there Ubuntu security notices feeds for specific releases

The  web page has an option to show only notices for a single release. Is there a way to get notices for a single release as a feed, without setting it up myself? That is, is there an official feed containing all and only Ubuntu 12.04 (for example) security notices?  The end goal is a tool which warns when any of a set of packages (not necessarily the ones installed on a system) for a single Ubuntu release are affected by a security notice.


Riemann-zeta Function Evaluated at $\zeta(0)$

WolframAlpha says that $\zeta(0) = - \frac{1}{2}$ but I can't seem to get that result.  I found that for $\Re(s) < 1 $, \begin{equation}\label{1} \zeta(s) = 2^s \pi^{s-1}\sin\Bigl(\frac{s\pi}{2}\Bigr)\Biggl[\int_{0}^\infty e^{-y}y^{-s}\,\, dy \Biggr]\zeta(1-s),\tag{1} \end{equation}  And for $\Re(s) > 0 $, $$\zeta(s) = \frac{1}{1-2^{1-s}} \cdot \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^s}.\tag{2} $$  If I want to calculate $\zeta(0)$, using (1), then on the RHS I get $\zeta(1)$ which is undefined.  So how would I calculate $\zeta(0)$?


While installing ubuntu from ubuntu software center, i got the following error:  package dependencies could not be resolved   After clicking detail button, shows the following error:      The following packages have unmet dependencies:  vlc: Depends: vlc-nox (= 2.1.6-0ubuntu14.04.1) but 2.1.6-0ubuntu14.04.1 is to be installed      Depends: libc6 (>= 2.15) but 2.19-0ubuntu6.6 is to be installed      Depends: libfreetype6 (>= 2.2.1) but 2.5.2-1ubuntu2.4 is to be installed      Depends: libgcc1 (>= 1:4.1.1) but 1:4.9.1-0ubuntu1 is to be installed      Depends: libgl1 but it is a virtual package      Depends: libqtcore4 (>= 4:4.8.0) but 4:4.8.5+git192-g085f851+dfsg-2ubuntu4 is to be installed      Depends: libqtgui4 (>= 4:4.8.0) but 4:4.8.5+git192-g085f851+dfsg-2ubuntu4 is to be installed      Depends: libsdl-image1.2 (>= 1.2.10) but it is not going to be installed      Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed      Depends: libstdc++6 (>= 4.6) but 4.8.2-19ubuntu1 is to be installed      Depends: libtar0 but it is not going to be installed      Depends: libva-x11-1 (> 1.3.0~) but it is not going to be installed      Depends: libva1 (> 1.3.0~) but it is not going to be installed      Depends: libxcb-composite0 but it is not going to be installed      Depends: libxcb-xv0 (>= 1.2) but it is not going to be installed      Depends: zlib1g (>= 1:1.2.3.3) but 1:1.2.8.dfsg-1ubuntu1 is to be installed


Say I have a table called listing and it has the following columns: id | name   | description | price | created_date|  0 | iPhone | A phone     | 1000  |   7/4/2020  |  Since I want to track when a listing is sold, I'm considering adding a sold_date column. My concern is that this would cause a bunch of rows in the listing table to have a null in the sold_date column since every listing wouldn't be considered sold. Would having null values be okay in this case, or should I create another table that would contain the sold_date column and references a listing?


I would like to have a different template for categories and subcategories The categories template is set in categories.php is it somehow possible to load the subcategories template from subcategories.php or something like that?


My beamer presentation presents this problem Package inputenc Error: Unicode char − (U+2212)(inputenc) not set up for use with LaTeX. \end{frame}. I tried remove some elements and I see that problem appear when I use - in equation. I'd like one hint about this problem.   \documentclass[pt]{beamer} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage[utf8]{inputenc} \usepackage[brazil]{babel} \usepackage{upgreek} \usepackage{mathtools} \usetheme{Berlin}  \begin{document} \begin{frame}{Convergência - Prova}     %\justifying     Sem perda de generalidade a demonstração foi focada numa partícula unidimensional. Reescrevendo a Equação, tem-se que     \begin{equation}     x_i(t + 1) + \alpha_1 x_i(t) + \alpha_2 x_i(t − 1) = \alpha_3     \end{equation}     onde     \begin{equation}     \begin{aligned}     \alpha_1 &= (1 + \omega) + u(r_1 - r'_1)c_1 + u(r_2 -r'_2)c_2 + c_1r{'}_1 + c_2r'_2 \\     \alpha_2 &= \omega \\     \alpha_3 &= u(r_1 - r'_1)c_1p + uc_2(r_2g - r'_2n) + c_1r'_1p + c_2r'_2n                         \end{aligned}     \end{equation} \end{frame} \end{document}   Sorry by english


How to bake without overlapping textures

I have an object with multiple materials. All these materials have their own textures and their UV maps overlaps. How can I bake without editing textures and not overlapping textures?


Changing array in method changes array outside

I have trouble with scope of variable.  public static void main(String[] args){     int[] test={1,2,3};     test(test);     System.out.println(test[0]+" "+test[1]+" "+test[2]); }  static void test(int[] test){     test[0]=5; }   I expected the output to 1 2 3, but the result was 5 2 3. Why I changed the value in the array in the method, but the original array changed?


Let $B$ be an $n \times n$ matrix. Does $B^3 = O_n$ imply $B = O_n$? If so, why?


How to change language of a specific application?

Is it possible to change the language of a particular application so that when opened it shows in Spanish for example while the rest are in English?  I have Spanish and English installed in Ubuntu and am using English as the default one but I would like a way to change the language for a particular application without having to change the whole language of the system.


Consider all $1000$–element subsets of $\{1,2,3,4,\dots 2015\}$. From each such subset select least element. Find Arithmetic Mean of all these elements.  I easily managed the trick but my approach got me a lengthy answer. I selected leaste numbers and multiplied them by their number of subsets possible such as; for $1$, number of subsets possible$=1016$, for $2$, $1015$ and so on. By adding this in series($1\times 1016 + 2\times 1015 + \dots 1016\times 1$) we would get the answer but it got to be a lengthy one.


How do I unzip, install and run the game Xonotic.zip?

I have downloaded Xonotic using the orange download button on the site, but now I have no idea how to:   Unzip the zip file of Xonotic Install Xonotic Run the game Xonotic   I have looked everywhere, please help.


Prouve that $\mathcal{F}\{\frac{dx(t)}{dt}\} = 2i\pi f \mathcal{F}\{x(t)\}$

I wanted to prouve that : $$\mathcal{F}\{\frac{dx(t)}{dt}\} =  2i\pi f \mathcal{F}\{x(t)\}$$ I started by the applying the definition of Fourier Transform and I integrated by parts: $\int_{-\infty}^{+\infty}\frac{dx(t)}{dt} e^{-2i\pi ft} dt$ = $\Big [x(t)e^{-2i\pi ft} \Big]_{-\infty}^{+\infty}$ +  $ 2i\pi f\int_{-\infty}^{+\infty}x(t) e^{-2i\pi ft} dt$ but I faced a problem in calculating $\Big [x(t)e^{-2i\pi ft} \Big]_{-\infty}^{+\infty}$ I couldn't calculate the limit of this complex number can I get some help with explanation? much appreciated


Diplomacy: No units but 1 Non-Home Supply Center

Hello Diplomacy enthusiasts.  I was recently playing an online game of Diplomacy with my friends and unfortunately drew Italy. All was going well until I was overrun by Turkey who made quick work out of Austria (and eventually went on to solo) and he agreed to let me survive in Tunis with an army so long I fight France and let him take my lands, as you do.  Anyways, in Spring 1911, he supported his fleet into my poor, 1 SC nation and I disbanded my unit. After a bit of negotiating, he vacated Tunis in the fall and I had 1 Supply Center that I couldn't build in, and 0 troops. When the game ended.  My question is whether I would have gained a share of the pot if I tied with the others.  Also, does it count as surviving?


My \cite{key} usage referring to bibliographies started to do this;    Not only I get a clickable numbered link (which is fine) I get the cite key on top of the reference. How can I turn this off?  I am using pdfTeX 3.1415926-2.5-1.40.14 through TeXLive on Debian.


I know "I know about him" but don't know "I know of him"  Question is: I know of him. What does this mean or imply? PS. think of vs know of is a totally different phrase


I am re-watching Game of Thrones and I came across this question.  Tywin Lannister is the Lord of Casterly Rock - But since his death, who is now the Lord of Casterly Rock?    Tyrion can't be the Lord as he is a fugitive. Jaime Lannister cannot be the Lord either as he's in the order of the Kingsguards. There is no indication that it's Cersei.   Has this ever been mentioned? I imagine that since Tywin's death, there would be a lot of enemies who will see this as a weakness and try to take this land?


Possessive form of coordinated noun phrases?

Which of the following is accurate in British English to describe our own wedding?        Alex and Jen's Wedding   Alex's and Jen's Wedding   Alex and Jens' Wedding


Where to ask about implementations of WS-* standards?

To avoid deletion in the future, questions that might lead to opinionated answers, with multiple good solutions like:     I recently started to read about SAGA pattern in the context of   distributed transactions for microservices and found out that is   actually an old concept that inspired the WS-* specs , more concretely   WS-Reliable Messaging,WS-AtomicTransaction, WS-Coordination, and   WS-BusinessActivity.      I searched for some concrete samples to understand better these   standards but despite their latest update in 2009 OASIS I did not   found much.      Do you know some implementation of the above mentioned WS standards?      Are they still actual as I mentioned before last update was like 10   years ago...?   Is there a site where I can ask the above question?


Where $\mathbb{Z}[x]$ is the ring of polynomials in $x$ with integer coefficients. The book I am studying says the unity of this ring is $f(x) = 1$ so then if some $p \in \mathbb{Z}[x]$ is a unit, this then must mean that $p^{-1} \in \mathbb{Z}[x]$, where $p \cdot p^{-1} = 1$, correct?   Obviously then $f(x) = 1$ and $f(x) = -1$ are units, and I have seen elsewhere on the internet that people claim these are the only units of $\mathbb{Z}[x]$, but aren't simple one-term polynomials also units? That is, $\forall k \in \mathbb{Z}, f(x) = x^k$ is a unit because $(f(x) = x^k)^{-1} \Longleftrightarrow f(x) = x^{-k}$ and $x^k \cdot x^{-k} = 1$, no?


Why when I click on the button does not give any reaction?

When i Click to submit - No reaction ! Help please ! PHP Form Not Work  I think error in form, please, check for first action and form connectedness   Login.php   <link rel="stylesheet" href="style.css">
     <form action="action.php" method="POST" class="log" id="log">
Log In
           Username:          <input type="login" name="loginl" id="login">           Password:          <input type="password" name="password" id="password">           Mail:          <input type="mail" name="mail" id="mail">          <input type="button" value="Submit" id="button">      </form>
    Action.php  <?php      $loginl = $_POST["loginl"];     $password = $_POST["password"];     $mail = $_POST["mail"];     $text = $_POST["text"];       $loginl = stripcslashes($loginl);     $password = stripcslashes($password);     $mail = stripcslashes($mail);     $text = stripcslashes($text);      $loginl = mysql_real_escape_string($loginl);     $password = mysql_real_escape_string($password);     $mail = mysql_real_escape_string($mail);     $text = mysql_real_escape_string($text);       $db = mysql_connect("localhost", "root", "usbw", "armus");     mysql_set_charset($db, "utf8");      $result = mysql_query("SELECT * from users where loginl = '$loginl' and password = '$password' and mail = '$mail'") or die("Failed to query database ".mysql_error());      $row = mysql_fetch_array($result);     if ($row['loginl'] == $loginl && $row["password"] == $password && $row["mail"] == $mail){         echo "Login Success!!! Welcome ". $row['text'] ;     } else {         echo "failed to login!";     }  ?>   output - NO RESULT  My PHP version - 5.4.17  where is my mistake?


Please help me for prove this inequality: $$\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\geq \frac{9}{a+b+c} : (a, b, c) > 0$$


What are the current state-of-the-art convolutional neural networks?

I'm interested in understanding which neural network architecture is currently the state of the art (sometimes abbreviated "SOTA") with respect to standard image classification tasks such as MNIST, STLN-10 and CIFAR. This is challenging because new results are published frequently, and it can be hard to keep up. Is there a resource or website which tracks the best results for these tasks?


How do I create a WiFi hotspot sharing wireless internet connection (single adapter)?

I know how to create a hotspot when connected to a wired network, but when I am using internet from a WiFi connection, this disconnects the wireless connection the moment I activate the hotspot.  In Windows I can use , which enables me to share the internet connection from the same wireless adapter as I am creating an access point on. As you can read on the :     Access Point mode allows you to create a hotspot using the same Wi-Fi card that you are using to access the Internet.   How do I do this on Ubuntu?


So where do we go now for library recommendations?

Stackoverflow used to be a good place for me to find a library for my specific requirements. Example:   Apparently, that is now considered "off topic". But these questions still exist, and people still want answers to them. The StackExchange format is also much better suited to this than, say, wikipedia. Yes, you will sometimes get opinions, but even opinions can be useful.  So, is there a different StackExchange sites where we can ask and look for these questions instead?


Is the old saying "Put a comma where you pause" a reliable way to punctuate sentences?

In grade school, it was taught that commas represent pauses in speech. The teacher often said to read sentences aloud and place commas wherever there was a short pause.  Yet there are various authorities online that say this is a terrible idea. For example,  tells readers that "this well-meaning advice is hopelessly misleading."  But then there are also some that are for the punctuate-by-breath method.  writes:      These rules may seem complicated. But there’s a simple test that usually works: When in doubt about whether or where to place a comma, read aloud the sentence in question, and visualize the comma as a hook that briefly makes the sentence run in place. If you hesitate or pause, insert the hook in the sentence to mark that place. If you don’t, don’t.    Is it a reliable rule of thumb? Or something that should be abandoned altogether?


Can I get chickenpox from meeting someone who lives with someone else with chickenpox?

Title mostly says it all. I've never had chickenpox. I was given chickenpox vaccine shots twice, once as an infant, and once at around 12-13 years old. I am now 23 years old. Am I safe? Or should I not meet this person until the other person (a 5 year old child, being cared for NOT by the person I might meet) has recovered? I'm not pregnant or otherwise in a category that should NOT risk chickenpox even a tiny bit, but obviously I'd rather avoid getting it.  I am asking both, the contagiousness of a housemate of a sick person, and whether my vaccinations are still effective (I understand it can't be 100% guaranteed).