I get this error when I try to update my Ubuntu 16.04. I already tried few solutions but nothing worked so far.  Error:  W: http://archive.canonical.com/ubuntu/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1) W: http://us.archive.ubuntu.com/ubuntu/dists/precise-security/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1) W: GPG error: http://extras.ubuntu.com/ubuntu precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192 W: The repository 'http://extras.ubuntu.com/ubuntu precise Release' is not signed. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1) W: http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1) W: http://us.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1) W: The repository 'http://ppa.launchpad.net/upubuntu-com/network/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch http://ppa.launchpad.net/upubuntu-com/network/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.   After un-checking few of unwanted packages/repositories from software and update section, I managed to get rid of few of the errors but still few errors are still existing:   The repository 'http://ppa.launchpad.net/upubuntu-com/network/ubuntu xenial Release' does not have a Release file.  N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.  N: See apt-secure(8) manpage for repository creation and user configuration details.  W: http://archive.canonical.com/ubuntu/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)  E: Failed to fetch http://ppa.launchpad.net/upubuntu-com/network/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found  E: Some index files failed to download. They have been ignored, or old ones used instead.   After applying the solution provided below( by Raphael),most errors got resolved. Except these errors:   W: The repository 'http://ppa.launchpad.net/upubuntu-com/network/ubuntu xenial Release' does not have a Release file.  N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.  N: See apt-secure(8) manpage for repository creation and user configuration details.  E: Failed to fetch http://ppa.launchpad.net/upubuntu-com/network/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found  E: Some index files failed to download. They have been ignored, or old ones used instead.

I started setting up by adding repositories and then went to run a sudo apt-get update again before I started installing other software, and I get the Signature key lines and it stops. So it essentially won't let me update any packages now.  d@EliteBook:~/Downloads$ sudo apt-get update Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease Hit:2 http://dl.google.com/linux/chrome/deb stable Release                      Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease               Get:5 http://ca.archive.ubuntu.com/ubuntu xenial InRelease [247 kB] Hit:6 http://ca.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:7 http://ca.archive.ubuntu.com/ubuntu xenial-backports InRelease Fetched 247 kB in 0s (256 kB/s)                    Reading package lists... Done W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by  key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1) d@EliteBook:~/Downloads$   I've never seen this before whenever I setup and start installing things in Ubuntu. Is there something else I can do?


I want to recover Windows 7 files installed on my C: drive. Ubuntu is installed on my D: drive.  How can I recover files on my Windows installation?

About two weeks ago I had a problem with my PC that my brother wrote a question about at .  I still haven't solved the problem, so my PC is unusable now.  Now I think that it would be simpler to re-install both Win7 & Ubuntu than repair them, but there're some data on their partitions. I want to recover this data.  These partitions are not mountable for some reason. I don't know why.  sudo fdisk -l about the problematic partitions:     Device    Boot      Start         End      Blocks   Id  System /dev/sda1            2048     147912703    73955328   83 Linux /dev/sdb2            206848   174079999    86936576    7  HPFS/NTFS/exFAT   And in GParted:      And the error of the mount command:  Failed to mount '/dev/sdb2': Invalid argument The device '/dev/sdb2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?   And the exact same message for /dev/sda1  How can I recover my data from those HDDs?  EDIT     I have tried to specify the type of the drive:  $ sudo mount -t ext4 /dev/sda1 /olddisk mount: wrong fs type, bad option, bad superblock on /dev/sda1,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so $ sudo mount -t ntfs /dev/sdb2 /olddisk NTFS signature is missing. Failed to mount '/dev/sdb2': Invalid argument The device '/dev/sdb2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?   EDIT     sudo ntfsfix /dev/sdb2 returns:  Mounting volume... NTFS signature is missing. FAILED Attempting to correct errors... NTFS signature is missing. FAILED Failed to startup volume: Invalid argument NTFS signature is missing. Trying the alternate boot sector Unrecoverable error Volume is corrupt. You should run chkdsk.


I want to use my shell script like this:  myscript.sh -key keyValue   How can I get the keyValue ? I tried getopts, but it requires the key to be a single letter!

I wish to have long and short forms of command line options invoked using my shell script.  I know that getopts can be used, but like in Perl, I have not been able to do the same with shell.  Any ideas on how this can be done, so that I can use options like:  ./shell.sh --copyfile abc.pl /tmp/ ./shell.sh -c abc.pl /tmp/   In the above, both the commands mean the same thing to my shell, but using getopts, I have not been able to implement these?


I have a peculiar case here which can be summed up as follows:  I want the entire error/stdout messages to be redirected to a file from my script but also there is one particular line which i want to redirect to terminal and also redirect that to the file.  This is the code:  exec &>test.log echo "Check if this line is going to test.log" echo "This should go to stderr" >> /dev/stderr   Now the last line should go to both stderr and test.log.  Can this be achieved somehow in bash ?

In bash, calling foo would display any output from that command on the stdout.  Calling foo > output would redirect any output from that command to the file specified (in this case 'output').  Is there a way to redirect output to a file and have it display on stdout?


I am wondering whether rainbows are three dimensional, and if so, what determine their depth? How to calculate the depth of a rainbow, given its radius?  From what I understand, all rainbows are circular and their radius are determined by the distance between the observer and the water drops. How can one determine the depth based on this information, assuming the depth is non zero?  Edit: As stated in a comment by Solomon Slow, a rainbow is not really an object. My question still applies, the rays of light that make us see a rainbow are coming from droplets. What is the depth extension of these (real) droplets?

My cousin shot .  In the picture it is clear that the mountain is behind the rainbow (the rainbow blocks the view of the mountain), whereas the nearby trees are in front of the rainbow. This got me thinking: how thick (deep) is the rainbow?  To make that more precise, imagine a plane taking off from the top of the mountain behind the rainbow and flying straight towards the camera. You could measure the relative strength of the plane / rainbow in the picture by a simple linear fit (assuming you knew its location). I imagine you'd see something like this:    How thick would this region be?


Does $$\lim_{(a, b) \to (0, 0)} \ \sqrt{\frac{a^2b^2}{a^2 + b^2}} = 0 \ ?$$   I'm trying to show that $$\lim_{(a, b) \to (0, 0)} \ \sqrt{\frac{a^2b^2}{a^2 + b^2}} = 0 $$  but I am getting stuck. I was thinking that as a starting point I could show that $$\lim_{(a, b) \to (0, 0)} \ \frac{a^2b^2}{a^2 + b^2} = 0 $$  and then conclude that since $$\lim_{x \to 0} \sqrt{x} = 0$$ and $\frac{a^2b^2}{a^2 + b^2} \to 0$ as $(a, b) \to (0, 0)$ we arrive at $$\lim_{(a, b) \to (0, 0)} \ \sqrt{\frac{a^2b^2}{a^2 + b^2}} = 0.$$    Firstly is my approach above a correct one. Secondly how can show that $$\lim_{(a, b) \to (0, 0)} \ \frac{a^2b^2}{a^2 + b^2} = 0. $$ Because I don't see any way to show the above (apart from perhaps proving it from the definition directly, which I would like to avoid if there is an easier way to do it). Also it could be the case that the initial limit doesn't even exist.

I was trying to evaluate $$ \lim_{(x,y) \rightarrow (0,0) } \frac{x^2y^2}{x^2 + y^2} $$ but only partially managed to do so through implying $y=kx$ but didn't find any other appropriate functions for this.


Hi My \paragraph after \subsubsection does not act as a section, the text continues on the same line as title. Please help.

I want to format paragraph to work as a regular title  \paragraph{title} text goes here   output of that is:  title text goes here    how can I change the output to force line break and use the usal indentation of 1st line?  title  text goes here  __  edit1: this is for a thesis and I'm using the document class - book. I don't want to use \subsubsection because this is the structure of the document. I just simply need one level of headers deeper.  And that is why I wanted to use \paragraph as a heading not as paragraph.  edit2: clarification: I'd like paragraph to behave like a header like section subsection subsubsection etc


I have some text like this: "Viewing 101-200 of 244".  I would like to find this with an xpath.    Right now I use this:   //*[contains(text(),'Viewing') and contains(text(),'of')] which is all very well and good but could potentially match other patterns.  What I would like to do is something like in a regular expression as in the following:  //*[contains(text(),'Viewing [0-9]+ of [0-9]+')]  But I can't figure out how to use wild cards as above.  Is there any way to do this?  My guess is no?

Something like .//div[@id='foo\d+] to capture div tags with id='foo123'.  I'm using .NET, if that matters.


I just saw this:    but there are no downvotes or anything:      Why?

When I visit the reputation tab of my profile, I see a lot of stuff. I can make out some of it, but not all.   What do all the event types mean? Why do some events show an odd reputation gain or not show any reputation change at all? Why are some events sometimes highlighted in yellow? My reputation suddenly dropped, but I don't see anything. What happened? Why do some events disappear from my reputation history?


This is a bit embarrassing.   BACKSTORY:  I got griefed recently in my friend's multiplayer server: the offender spawned loads of Ender Dragons which attacked me, and then he kicked me out and banned me.  I've been given access again (and the offender has himself been banned).    Actual question:  I'm now back in creative mode, difficulty=peaceful, carrying on with my building.  But all the Ender Dragons are still hanging around and getting in the way - they're really distracting.  I've tried attacking them with a diamond sword but haven't managed to kill a single one yet.  There must be a command i can type to get rid of them all - is there?  EDIT - i've googled this a bit and a common solution is to do /killall or /killall EnderDragon but the /killall command doesn't seem to be activated on this server.  thanks, Max

I recently opened a map which I thought was broken, because I could not load it anymore. I increased the memory for the Java VM to 8GB and now I can open it but it is impossible to play on this map, because there are thousands of cows! I think this is why the map could not be opened with 768 MB of memory for Java.  So my question is, if there is any tool with which I can remove those cows. I've heard of several tools to manipulate the landscape, your spawn point, etc. But I don't know if there are tools that let you remove and place animals without having the map opened. When I open the world I have like one frame every 5 seconds...  Can you recommend a tool with which I can remove animals or other entities from a Minecraft world?


I want a program to convert user input to an integer and store it in a list only if it can be. If the input is not able to be converted to an integer, the program should just continue and ignore the input.

What is the best possible way to check if a string can be represented as a number in Python?   The function I currently have right now is:  def is_number(s):     try:         float(s)         return True     except ValueError:         return False   Which, not only is ugly and slow, seems clunky. However I haven't found a better method because calling float in the main function is even worse.


I would like to minimise the function $l(\theta|Y)$.  Given the Newton's method below  $$\theta^{(t+1)} = \theta^{(t)} - \left[l''(\theta\;|\;Y)\right]^{-1} l'(\theta^{(t)}\; | Y)\quad t = 0,1,...$$  where $l''(\theta^{(t)} | Y)$ is the observed Fisher Information matrix.   The observed fisher information matrix (including the minus sign in front of it) would ideally be negative definite, in order to find the minimum. Correct me if I am wrong.   My question is: what if the observed Fisher Information I obtained is negative semidefinite. What may happen is this case ? Would my algorithm fail miserably ?

Jeffrey Wooldridge in his Econometric Analysis of Cross Section and Panel Data (page 357) says that the empirical Hessian "is not guaranteed to be positive definite, or even positive semidefinite, for the particular sample we are working with.".  This seems wrong to me as (numerical problems apart) the Hessian must be positive semidefinite as a result of the definition of the M-estimator as the value of the parameter which minimizes the objective function for the given sample and the well-known fact that at a (local) minimum the Hessian is positive semidefinite.  Is my argument right?  [EDIT: The statement has been removed in the 2nd ed. of the book. See comment.]  BACKGROUND Suppose that $\widehat \theta_N$ is an estimator obtained by minimizing $${1 \over N}\sum_{i=1}^N q(w_i,\theta),$$ where $w_i$ denotes the $i$-th observation.  Let's denote the Hessian of $q$ by $H$, $$H(q,\theta)_{ij}=\frac{\partial^2 q}{\partial \theta_i \partial \theta_j}$$  The asymptotic covariance of $\widehat \theta_n$ involves $E[H(q,\theta_0)]$ where $\theta_0$ is the true parameter value. One way to estimate it is to use the empirical Hesssian  $$\widehat H=\frac{1}{N}\sum_{i=1}^N H(w_i,\widehat \theta_n)$$  It is the definiteness of $\widehat H$ which is in question.


I want to write a code which gives me all the possible combinations of n elements in a k length k>n.The issue with this code is that i run out of memory quite fast.I was wondering if someone knew how to fix this with generators.I don't want to get all the possible combinations of a list elements. I want to get all the combinations of the elements in a certain length. Thanks.  def allstrings(alphabet, length):     """Find the list of all strings of 'alphabet' of length 'length'"""      if length == 0: return []      c = [[a] for a in alphabet[:]]     if length == 1: return c      c = [[x,y] for x in alphabet for y in alphabet]     if length == 2: return c      for l in range(2, length):         c = [[x]+y for x in alphabet for y in c]      return c  if __name__ == "__main__":     for p in allstrings(['a','b','c'],4):         print (p)

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


public class Foo { public static void change(int[] arr){     arr = null; } public static void change2(int[] arr){     arr[0] = 99; } public static void main (String[] args){     int[] arr = {1,2,3,4,5};     change(arr);     System.out.println("it should null: "+Arrays.toString(arr));     change2(arr);     System.out.println("updated array : "+Arrays.toString(arr)); }   }   CONSOLE OUTPUT  it should null: [1, 2, 3, 4, 5]  updated array: [99, 2, 3, 4, 5]   I need to get understanding about pass by reference as i passed int[ ] to first method i.e change() it does not null the array as per my understanding it should change to NULL as array references are pass by reference but if i pass array to second method i.e change2() it changed the value at specific index. It means that reference is being passed.

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


The review queue shows a lot of comments that were posted as an answer. The review possibilites only allow to keep the "answer" or flag it (which will usually result in a deletion).  Most of these "answers" are indeed valid comments, providing useful questions, links, etc.!  It would add value to Stackoverflow (etc) to convert these answers to a comment (below the initial question) with one click.

I answered a  which Dennis Washington correctly pointed should have been a comment than an answer.   Is there any way to change an answer to a comment while still respecting the sentiments of the contributor to help intact?


We have a Wordpress based website that gets about 1.5 million pageviews per day. Maximum concurrent sessions reach up to 5000 users per minute at times.  We have one web and one database server. Specs for both machines are as follows:  CPU: 2 x Intel(R) Xeon(R) CPU X5650 @ 2.66GHz 12M Cache / 6 Cores / 12 Threads (x2) Memory: 24GB Drive(s)(size/GB) - 4x240gb SSDs RAID 10   We run on Nginx, use FastCGI, and also use APC for caching, along with simple page caching with WP Super Cache.  Current Nginx configuration is as follows:  worker_processes  24; worker_rlimit_nofile 200000; worker_connections  4000;   FastCGI settings are as follows:  FcgidMaxProcesses 200 FcgidProcessLifeTime 3600 MaxProcessCount 100 FcgidIOTimeout 400 FcgidIdleTimeout 600 FcgidIdleScanInterval 90 FcgidBusyTimeout 400 FcgidBusyScanInterval 80 ErrorScanInterval 3 ZombieScanInterval 3   Server fails and we get Nginx errors (502-504) during high traffic. I am wondering if this is related to a bad configuration.  Your assistance is much appreciated.

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


I have a site based on tutorials about stuff I learned and shared them to the world. Its true that we (me and my friend) started writing less on the blog due to us being busy with some other projects. Anyway, the site has been growing steady for the past few months now, a few days ago we noticed a drop in traffic of about 30% to 40%.  I've also had 2 IPs assigned to this website and one of these IPs unfortunately had some issues and no traffic could be sent to it for around a week or so and just the other day fixed it. In this time, if the site was receiving visits to that IP, it would be getting errors due to connection issues.  Nothing much was changed on the site, we just woken up and saw the drop in traffic.  Has anyone else experience this? Does anyone have any advice to fix this or just wait for google to pickup that the site is back to normal?  Most of the visits, over 85% come from google, surprisingly adsense performs the same or even better.  Looking forward for any advice on this.  Bogdan

There has been a significant drop (90%) in traffic from Google to one of my well-established sites (6+ years) in the last week. Searches show that the top 3 wide keywords all dropped 4 spots. Searches for other keywords do not show ANY results in the first 10 to 25 pages of results, while previously one 1st or 2nd page at most.  Since there are , the question really is:  What steps are necessary to figure out what caused such a drop?  There have been no major changes during this period or the last month on the site and certainly not in the homepage which has dropped in rank. Over all the years of running this site and plenty of others, I have never experienced this. There are is duplicate content on my site and I have rigorously used canonical links for the last few years to ensure it is not misinterpreted as such.


I have a desktop with Windows 10. I need to install Ubuntu or launch it using USB. But when I try to do either of those  things, I read      no input registered   Then the display is locked on the Ubuntu logo with 3 points.   CPU: ryzen 7 3700x GPU: rx 5700xt  RAM: 16gb ddr4 corsair Mobo: msi b450 a pro   What could be the problem and how can I fix it?

I want to burn Ubuntu Minimal CD ISO to an old, 1 GB USB thumbdrive. Regular ISO doesn't fit. I already tried Startup Disk Creator and Unetbootin but both failed. I tried installing GRUB and pointing it to boot like this:  insmod part_msdos linux /linux initrd /initrd.gz   but it doesn't work. I also tried dd but I ended up with not bootable drive.  Rufus worked on Windows with the same thumbdrive but I no longer use Windows.  What else can I do?


Here's a question I've recently come up with:      Prove that for every natural $x$, we can find arbitrary number of integers in the interval   $[x^2,(x+1)^2]$ so that their product is in the form of $2k^2$.   I've tried several methods on proving this, but non of them actually worked. I know, for example, that the prime numbers shouldn't be in the product. I was also looking for numbers $x$ so that between $x^2$ and $(x+1)^2$ there is actually the number $2k^2$ for some natural $k$. If we find all of these numbers, then we should prove the case only for the numbers which are not in this form. These $x$s have this property: $x^2<2k^2<(x+1)^2$ leading to $x<k\sqrt 2<x+1$ and $x\frac{\sqrt 2}{2}<k<(x+1)\frac{\sqrt 2}{2}$. This means there should be a natural number between $x\frac{\sqrt 2}{2}$ and $(x+1)\frac{\sqrt 2}{2}$. I've checked some of the numbers that aren't like that with computer, and they were: $3,6,10,13,17,...$. the thing i noticed was that the difference between the two consecutive numbers of that form, is either $3$ or $4$. I think this has something to do with the binary representation of $\frac{\sqrt 2}{2}$ but I don't know how to connect it with that. I would appreciate any help :)

For every positive integer $n$, there exists a set $S\subset \{n^2+1,n^2+2,\dotsc,(n+1)^2-1\}$, such that   $$\prod_{k\in S}k=2m^2$$  for some positive integer $m$  I have no clue about it. Could anyone help me? Thanks a lot.  p.s. Whether or not the problem was a conclusion of an paper is unknown.


I need to create a SELECT statement, this SELECT statement will use an IN to check whether a department has had a sale with a price over 90.00 dollars BUT the sql MUST use the WITH statement which will be used to select all columns from sales where the price is greater than 90.00, you must call this sub-query special_sales.  departments table schema id name  sales table schema id department_id (department foreign key) name price card_name card_number transaction_date  resultant table schema id name   NOTE: Your solution should use pure SQL.  IN WHERE WITH special_sales SELECT  DISTINCT d.*  FROM    departments d  JOIN    sales       s  WHERE   d.id = s.department_id  AND     s.price > 90  ORDER BY d.id;   this is the code I did but I received an sql error

I'm trying to use MySQL to create a view with the "WITH" clause  WITH authorRating(aname, rating) AS    SELECT aname, AVG(quantity)    FROM book    GROUP BY aname   But it doesn't seem like MySQL supports this.  I thought this was pretty standard and I'm sure Oracle supports this. Is there anyway to force MySQL to use the "WITH" clause?  I've tried it with the MyISAM and innoDB engine.  Both of these don't work.


Steps to reproduce:   Click Reject   Click the X in the corner to close the reject window   This happens forever (until a refresh)    3a. Also, I see a JS error:     I'm using Chrome 31.0.1650.48, on Windows 7.  The same problem occurs when I press Esc, but clicking outside of the popup box does not seem to cause this issue.

If you go to review a suggested edit and close the Reject dialogue box, the button at the top-right will continue to say "Rejecting...". You will not be able to continue with the review process.  I have refreshed the page, and tried clearing my cache. If I refresh the page, I can continue reviewing the edit.  I'm using Chrome Version 31.0.1650.57 m.


I have created a Point class which creates a 2D point and a Segment class which inherits from the Point class.I wanted to test and print the length of the segment,but it gives null pointer exception.  Point.class      public class Point {             protected double x;         protected double y;          public Point(double x,double y){                 this.x=x;             this.y=y;         }         public double getX(){return this.x;}         public double getY(){return this.y;}         public double distance(){             double dist=Math.sqrt(this.x * this.x+this.y * this.y);             return dist;         }         public double distance(Point point){             double dx=this.x-point.x;                 double dy=this.y-point.y;             double dis=Math.sqrt(dx*dx+dy*dy);             return dis;         }          void translate(double dx,double dy){             this.x=dx+this.x;             this.y=dy+this.y;          }          public static Point barycenter(Point[] points){             float bx=(float) ((points[0].x+points[1].x)/2);             float by=(float)(points[0].y+points[1].y)/2;             Point b=new Point(bx,by);             return b;          }     }   Segment.class      public class Segment extends Point{         public Segment(double x, double y) {            super(x, y);         }         Point p1;         Point p2;          public void set1(double a,double b) {             p1.x=a;             p1.y=b;         }         public void set2(double a,double b) {                 p2.x=a;             p2.y=b;         }          public double getx1() {             return p1.x;         }         public double getx2() {             return p2.x;         }         public double gety1() {             return p1.y;         }         public double gety2() {             return p2.y;         }         public double length() {             double l=Math.sqrt((p2.x-p1.x)*(p2.x-p1.x)+(p2.y-p1.y)*(p2.y-p1.y));             return l;         }        }   Main.class      public class Main {         public static void main(String[] args) {             Point a1=new Point(4.0, 8.9);             Point a2=new Point(7.3, 6.0);             Segment ab=new Segment(3.0,4.0);             System.out.println(ab.length());         }     }   This is the output i am getting     Exception in thread "main" java.lang.NullPointerException        at Segment.length(Segment.java:31)        at Main.main(Main.java:5)   When in fact i would like to get a different answer. How do i get rid of this problem?

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


I’m trying to learn threading in C#, and I’ve seen something crop up in few articles but I am not sure I fully understand it: In the given two examples, what would the fundamental difference between getting a lock on ‘this’  vs ‘thisLock’.  Example 1:  class Account     {         decimal balance;         private Object thisLock = new Object();          public void Withdraw(decimal amount)         {             lock (thisLock)             {                 if (amount > balance)                 {                     throw new Exception("Insufficient funds");                 }                 balance -= amount;             }         }     }   Example 2:  class Account     {         decimal balance;          public void Withdraw(decimal amount)         {             lock (this)             {                 if (amount > balance)                 {                     throw new Exception("Insufficient funds");                 }                 balance -= amount;             }         }     }   From my understanding, I would of thought that ‘thisLock’ only stops other threads from entering that specific area of code.   Were as getting a lock on ‘this’ would stop all operations on the object, i.e. calls to other methods by other threads?  Have I fundamentally miss understood this, or is that the correct conclusion?

The  says that public class SomeObject {   public void SomeOperation()   {     lock(this)     {       //Access instance variables     }   } }  is "a problem if the instance can be accessed publicly". I'm wondering why? Is it because the lock will be held longer than necessary? Or is there some more insidious reason?


$$\int_0^{\infty} \frac{\sin^2(x)}{x^2(x^2+1)} dx$$  The integral is equals with $\frac{\pi}{4}+\frac{\pi}{4e^2}$, but i can't prove it.

Use differentiation with respect to parameter obtaining a differential equation to solve  $$ \int_0^\infty \frac{\sin^2(x)}{x^2(x^2+1)}dx $$ No complex variables, only this approach.  Interesting integral and it should have a nice ODE.  I have not found the right way yet.  we have singularities at $x=\pm i$.


I created regular expression for nodejs aggaregate query. But can not create it.  Here, is my code.      var device = "HPM220";     var expression = /^[device].*/i;     console.log(expression);   My device name is "HPM220". but my output is /^[device].*/i. It is wrong output.  The output should be /^[HPM220].*/i  What mistake i did here?

I would like to create a String.replaceAll() method in JavaScript and I'm thinking that using a regex would be most terse way to do it.  However, I can't figure out how to pass a variable in to a regex.  I can do this already which will replace all the instances of "B" with "A".  "ABABAB".replace(/B/g, "A");   But I want to do something like this:  String.prototype.replaceAll = function(replaceThis, withThis) {     this.replace(/replaceThis/g, withThis); };   But obviously this will only replace the text "replaceThis"...so how do I pass this variable in to my regex string?


Let $p$ and $q$ be distinct primes. Then find the number of positive integer solutions of the equation $$\frac{1}{x}+\frac{1}{y}=\frac{1}{pq}$$   We get $pq=\frac{xy}{x+y}$  Now $x+y$ must divide $xy$ as L.H.S. is a positive integer with two prime factors but how do we make sure the same on R.H.S. ?  Given options are $3$ or $4$ or $8$ or $9$.

For $x,y\in\mathbb{N}$ how many ordered pairs $\left(x,y\right)$ satisfy   $\dfrac{1}{x}+\dfrac{1}{y}=\dfrac{1}{pq}$ where $p,q$ are distinct primes?


I must be missing something obvious here, but I can't see it.  The \SetTitle nacro defines a title along with an extended title. The extended title is printed in parenthesis, if it is provided. Thus \SetTitle[$\sin$]{Sine Function} should produce  Sine Function (sin)  and \SetTitle[]{Sine Function} should produce Sine Function  but I get the trailing () for some reason.  Code: \documentclass{article} \usepackage{amsmath} \usepackage{xparse} \usepackage{ifmtarg}  \makeatletter \newcommand{\IfIsEmptyArg}[3]{\@ifmtarg{#1}{#2}{#3}}% \makeatother  \DeclareMathOperator{\MyOperator}{op}%  \newcommand*{\NameExtended}{} \newcommand*{\Name}{} \NewDocumentCommand{\SetTitle}{%     s%   #1 = UNUSED in this MWE     O{}% #2 = extended name     m%   #3 = name }{%      \renewcommand*{\Name}{#3}%     \renewcommand*{\NameExtended}{#2}% }% \newcommand*{\ShowName}{%     \par\hspace*{1.0cm}\Name     \IfIsEmptyArg{\NameExtended}{%         %% Since \NameExtended not provided don't print it.      }{%         ~(\NameExtended)%     }% }%  \begin{document}     \SetTitle[$\sin$]{Sine Function}     \ShowName              \SetTitle[$\MyOperator$]{My Operator}     \ShowName          \medskip\par     Following should NOT have trailing "()":          \SetTitle{Sine Function}% Default parameter not specified     \ShowName          \SetTitle[]{My Operator}% Default parameter specified     \ShowName \end{document}

I have a macro which holds some text value, e.g. \macro{some text}. If it is empty, I would like for nothing to appear in the document, but it has some content of any kind which would produce text displayed in the document, I would like a message to appear, "Text: some text".   \macro{} would be considered empty. \def\somedata{}, \macro{\somedata} would be considered empty. \macro{0} would be considered not empty.   I have tried making a TeX conditional which can check if the value is not empty, but nothing I tried works, e.g.:  \ifx #1 {} \else     Text: #1 \fi  \ifx#1{} \else     Text: #1 \fi  \ifx #1 \nil \else     Text: #1 \fi  \ifx#1!="" \else     Text: #1 \fi   What is the correct syntax for creating a conditional in plain TeX with checks if a value is not empty?


I did a simple application with 2 buttons (start and exit) and an empty TextView. If i push the start button, a TextView will be update. My problem is that if i rotate the device, my layout will restart (if start was pushed, the TextView will become empty again. Why?

In my Android application, when I rotate the device (slide out the keyboard) then my Activity is restarted (onCreate is called). Now, this is probably how it's supposed to be, but I do a lot of initial setting up in the onCreate method, so I need either:   Put all the initial setting up in another function so it's not all lost on device rotation or Make it so onCreate is not called again and the layout just adjusts or Limit the app to just portrait so that onCreate is not called.


I'm at the state of frustration trying to install MySQL 8.0 on my Ubuntu 18.04 box.  I have searched and see many answers (and also a lot of posts about failures) but nothing is working.  I start by the following:  wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb   And then this:  dpkg -i mysql-apt-config_0.8.13-1_all.deb   On checking my apt package I see a new file created, /etc/apt/sources.list.d/mysql.list, but the content can't possibly be right for 8.0! - content here:  ### THIS FILE IS AUTOMATICALLY CONFIGURED ### # You may comment out entries below, but any other modifications may be lost. # Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications. deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-apt-config # deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7 deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools #deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools-preview # deb-src http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7   Anyway, next step is this:  dpkg -i mysql-apt-config_0.8.13-1_all.deb   This give me a UI which looks correct:    Leading to this selection:    When I select OK on THIS option, I am sent back to the first screenshot.  Then that takes me to the 2nd.  I am now in an infinite loop.  When I hit escape, I get the following message:  Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)   At this point, I don't know what further steps to take.  My thoughts are, is there any way to install MySQL 8.0 directly without apt-get?  I am appreciative of any and all solutions here, thanks.

I have a Drupal site 8.6.10 on an Ubuntu server 18.04 with MySQL 5.7.25  I want to update MySQL to version 8.0  Here are the steps I followed :   I backed up my database. I uninstalled MySQL from my server with the commands :  $ sudo systemctl stop mysql $ sudo apt remove mysql-* $ sudo apt purge mysql-* $ sudo apt autoremove $ sudo dpkg -l | grep mysql | grep ii  I added the repository with the command :  $ wget https://repo.mysql.com//mysql-apt-config_0.8.12-1_all.deb  I installed the package with the command :  $ sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb            My problem :   I install MySQL with the command :  $ sudo apt update $ sudo apt install mysql-server    When I do step 5, it installs MySQL 5.7 why does not it install version 8 ?


(I think I understand how to show $\mathbb{Z}[i]/\langle5\rangle \cong \mathbb{Z}/5\mathbb{Z} \times \mathbb{Z}/5\mathbb{Z}$ using the Chinese remainder theorem.)  I don't know how to "identify the structure of the additive group" of $\mathbb{Z}[i]/\langle 3 + 4i \rangle$. The answer is apparently $\mathbb{Z}/25\mathbb{Z}$, and the solutions say to show that $$ \phi : \mathbb{Z}[i]/\langle 3 + 4i \rangle \to \mathbb{Z}/25\mathbb{Z} \qquad \text{given by} \qquad a + ib \mapsto a - 7b $$ is an isomorphism. There are a few things I note:  $7^2 = -1 \mod{25}$ $\phi(3 + 4i) = 0$ $25 = 3^2 + 4^2$  But, I can't put the pieces together. What I want to know is:  Why is it 25 in $25 \mathbb{Z}$? How can we guess to send $a + ib$ to $a - 7b$?

I'm trying to get through a proof of Gauss' that certain primes can be written as the sum of two squares. An assumption is that      the order of $\mathbb{Z}[i]/(a+bi)$ is $a^2+b^2$.   I get that $(a+bi)(a-bi)=a^2+b^2$, so this places a bound on the order of integers with no imaginary part. But since $b$ isn't a unit, it doesn't seem like this finishes the proof.  Any hints?


I suppose it’s easy to prove. I mean a and b are such that gcd(a, b) = 1, where a and b are integers. I should clarify n is a positive integer.

I'm trying to prove that $\sqrt[n]{\frac{s}{t}}$ is irrational unless both s and t are perfect nth powers. I have found plenty of proofs for nth root of an integer but cannot find anything for rationals. Also trying to work up from the proofs I have found is rather difficult.  My lecturer wants me to prove this using uniqueness of prime factorisation but I also have no idea where to start with that.   Any help is greatly appreciated.


We all know that if we Highest Common Factor (or Greatest Common Divisor {As you  prefer}) and the Least Common Multiple two numbers , then ALL WE KNOW is ->   H.C.F $/cdot$ L.C.M $=$ Product of 2 numbers {Well,as pef my knowledge , this is only applicable for 2 numbers}  Is there any kind of proof of this famous relation ??

I'm looking for an understandable proof of this theorem, and also a complex one involving beautiful math techniques such as analytic number theory, or something else. I hope you can help me on that. Thank you very much


I need to compile a small C program (shared lib for a Perl module) on an old Solaris 8 (Sparc) server. Unfortunately the development tools are not installed and I'm getting:  /usr/ucb/cc:  language optional software package not installed  I've got access to Solaris resources on support.oracle.com but don't know what to look for. SolarisStudio 12.3 only seems to support Solaris 10+. Any idea where to get a native C compiler for Solaris 8?  Edit: The other question (supposed to be duplicate) doesn't really help. Anyway the solution is to install Sun Studio 11 - the last version that supports Solaris 8 and Solaris 9. Oracle patch 12685437 fwiw.

I tried to compile some C code to get object file from a shell prompt:  $cc a.c     But this gives me the following error:  /usr/ucb/cc:  language optional software package not installed   How can I compile C code?


Let $A = \{1, 2, 3, 4\}$, and let $F$ be the set of all functions from $A$ to $A$. Let $S$ be the relation on $F$ defined by:  $\forall f, g \in F$, $fSg \iff f(i) = g(i)$ for some $i \in A$  Let $h: A \to A$ be the function defined by $h(x) = 1$ for all $x \in A$ How many functions $g \in F$ are there so that $gSh$?  So for whatever $x \in A$, $h(x) = 1$. So I want to find how many functions $g \in F$ exist so that $gSh$.   So I made a sort of "recipe" for counting how many functions $g$ exist. Since in order for $gSh$, $g(i) = 1$ for any $i \in A$, since $g(i) = h(i)$ if $gSh$.  Step 1: Map $1 \to 1$   Step 2: Map $2 \to 1$   Step 3: Map $3 \to 1$  Step 4: Map $4 \to 1$   So this is just equal to $1 * 1 * 1 * 1$. So my assumption is that there exists only $1$ function $g$ such that $gSh$. Is this correct? I think I might be misunderstanding the wording, and just want to make sure. Thanks in advance.

Let $A = \{ 1,2,3,4 \}$ Let $F$ be a set of all functions from $A \to A$.  Let $S$ be a relation defined by : $\forall f,g \in F$ $fSg \iff f(i) = g(i)$ for some $i \in A$  Let $h: A \to A$ be the function $h(x) = 1 $ for all $x \in A$.   How many functions $g \in F$ are there so that $gSh$ ?  My solution : $gSh$ means that $g(i) = h(i)$ for some $i \in A$. So $g(i) = 1$.  So number 1 always needs to connect to some x - 4 choices.  Then we have $3$ left-over numbers that can connect to $4$ numbers each.  So solution is $4 \cdot 4 \cdot 4 \cdot 4$. Is this correct at all? Thanks in advance !! :)


Suppose ${3^x} + {4^x} = {5^x}$.  What is zero of this equation?

I would like to prove that the equation $ 3^x+4^x=5^x $ has only one real solution ($x=2$)  I tried to study the function $ f(x)=5^x-4^x-3^x $ (in order to use the intermediate value theorem) but I am not able to find the sign of $ f'(x)= \ln(5)\times5^x-\ln(4)\times4^x-\ln(3)\times3^x $ and I can't see any other method to solve this exercise...


While visiting one of my Websites i saw this black screen in the Screenshot attached. It was just for some seconds. Anyone know what it is? is it a hack? Im running on Centos8, with Litespeed and Cyberpanel

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


How could I compute the following integral: $$\int\limits_0^\infty  {{{\sin (ax)} \over {{e^{2\pi x}} - 1}}dx} $$ ? Thank you.

I have been self-studying CA and find it very interesting. So, working through problems in a book I have, I ran across  $$\int_{0}^{\infty}\frac{\sin(ax)}{e^{2\pi x}-1}dx=\frac{1}{4}\coth(a/2)-\frac{1}{2a}$$  and $$\int_{0}^{\infty}\frac{\sin(ax)}{e^{x}+1}dx=\frac{1}{2a}-\frac{\pi}{2\sinh(\pi a)}$$  For the former, I wrote it as $\frac{e^{aiz}}{e^{2\pi z}-1}$ and used a rectangular contour with vertices $0, \;\ R. \;\ R+i, \;\ i$  $e^{2\pi z}-1$ has poles at $ni$. Of these, I think $i$ only lies within the contour.   Unless I am in error, I then calculated the residue at $i$ to be $\frac{e^{-a}}{2\pi}$  So, $2\pi i(\frac{e^{-a}}{2\pi})=ie^{-a}$  Now, where I get hung up is setting up the integrals around the contour. Two of which should tend to 0 as $R\to \infty$.  Here is what I done.  $$\int_{0}^{R}\frac{e^{iax}}{e^{2\pi x}-1}dx+\int_{0}^{\infty}\frac{e^{ai(R+iy)}}{e^{2\pi (R+iy)}-1}idy+\int_{R}^{0}\frac{e^{ai(x+i)}}{e^{2\pi (x+i)}-1}dx+\int_{\infty}^{0}\frac{e^{ai(iy)}}{e^{2\pi iy}-1}dy=-\sinh(a)$$  I am unsure of the limits on the second and fourth integrals.  I am not so sure this is correct. The second and fourth ones, which represent the vertical sides,  should tend to 0 as $R\to\infty$. I hope :).   This than gave me $(1-e^{-a})\int\frac{e^{iax}}{e^{2\pi x}-1}dx=-\sinh(a)$.  Which does not look correct. I did manage to solve this using series and $\pi csc(\pi z)$, but the contour I am unsure of.   Can someone lend a hand here?. Any advice on either would be appreciated.   For the other one, I only posted it because it looks similar, but I believe is actually more involved and 'tougher' if you will. If I can get one, perhaps I can manage to evaluate the other.  With that one, I think the same rectangle with the same vertices can be used, but $\pi i$ would have to be avoided. Perhaps a Principal Value in there somewhere. But, I was told to use vertices $0, \;\ R, \;\ R+2\pi i, \;\ 2\pi i$  Since I am relatively new to CA, setting up those integrals is the confusing part.    I can do easier types of contour integrals, but want to learn more about these more challenging ones.   Thanks for any assistance.


I have the following sample code:   recs = [] for x in range(1,3):     rec = {         'A': x     }     recs.append(rec)     print(rec)     for y in range(1, 3):         rec['B'] = y         recs.append(rec)         print(rec)  print('----- Array after exiting loops') for r in recs:     print(r)   This gives this output:  {'A': 1} {'A': 1, 'B': 1} {'A': 1, 'B': 2} {'A': 2} {'A': 2, 'B': 1} {'A': 2, 'B': 2} ----- Array after exiting loops {'A': 1, 'B': 2} {'A': 1, 'B': 2} {'A': 1, 'B': 2} {'A': 2, 'B': 2} {'A': 2, 'B': 2} {'A': 2, 'B': 2}   Now I can resolve it with this code:   for y in range(1, 3):     rec2 = rec.copy()     rec2['B'] = y     recs.append(rec2)     print(rec2)   What I am looking for is explaining why this behaviour occurs when you go into a nested loop.

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I am making a poker game (Texas Hold Em) and am wondering if I should be making a static class that controls all AI for simplicity or should I be aiming at making it in itself an instance so that each player could possibly use a different algorithm? I mean it is poker so I suppose there could be a decent scope on strategy but I could probably create a static class that randomly chooses a statistic ratio for their decisions...I don't want a boring AI that is completely predictable  Currently I have a object to represent the cards as strings and when passed a string from an array of card strings it returns its ImageView equivalent, then I have an Object for the rules that dictate what can and can't be currently done as well as analyzing against the community cards for the best hand and returns the type of hand the player has and temporarily stores the cards that made up that hand in case two players have a similar hand and needs to figure out which one wins. Then I have the player class which basically sets whether that player has checked called or folded.  Edit: Also I have rewritten the way cards are dealt about 3x's. I basically am trying to design the game in such a way that different poker styles can be added later and perhaps maybe even blackjack

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I have a 74.4 SSD drive.  Disk Properties tell me that it has around 2 GB left.      However, if you add up all the files & folders, only ~ 60 GB is taken up.  Where are the other 14 GB?

I'm trying to determine what's eating almost half of disk on my Windows 7 Lenovo laptop but haven't been able to determine what.  I read some of the answers on this site but none of the causes seems to be the cause of my problem.  What I've done so far:   Checked Windows' System Restore points but only minimum use, either way I deleted around 2GB if usage from there Used WinDirStat and it came back with a total of 71.3GB usage at the root level C Drives properties says 135GB being used out of 138 GB total, ie, 135 GB - 71.3GB = 63.7GB missing somewhere No "Unknown" files reported by WinDirStat Windows Disk Management utility doesn't report any unused partitions or unclaimed space chkdsk comes out clean Windows disk cleanup tool doesn't report anything big, just small stuff in the lower MB range Lenovo backup tool hasn't been used nor there is a folder for the backup images   Any idea on what to look at and/or do?  EDIT: some additional info...


Is there a way to migrate a question that is already closed without first reopening it and closing again as off-topic to migrate?

Sometimes a question gets closed as off-topic (not-migrated) while there is another site where the question is on-topic.  If a moderator wants to migrate the question, the moderator needs to reopen the question and then reclose it as off-topic and migrate the question.  It would nice if a moderator can migrate questions closed as off-topic without going through this process of reopening/reclosing.


I am using data table for displaying data from the database. There is some space between two columns of the data table. How to reduce the space between them. I tried cellspacing but it is deprecated in html5. Is there any possible way to do this.

In an HTML table, the cellpadding and cellspacing can be set like this:  <table cellspacing="1" cellpadding="1">   How can the same be accomplished using CSS?


I'm shopping for a new road bike, probably a Cannondale Synapse or a SuperSix Evo Carbon. Since this is around the time the new models for 2017 are going to come in, shouldn't this be the time when I'll be able to get the 2016 ones lower than retail prices? All the LBS I've looked at are carrying these at full retail prices.   Is there an ideal time to shop for bikes to get them at bargain prices? Are there any other tips to get Bikes at a reasonably lower price than full retail price?

Is there a month when new models come out and dealers discount stock like with cars?  Do they raise prices in the spring and lower them in the winter?


Should monotonic sequence theorem be used? Thanks in advance.

How can I prove that this iterative sequence converges to $2$? Can I use the convergence definition?  $$a_{n+1} = \frac{a_n}{2} + \frac{2}{a_n},\qquad  a_0 = 4  $$  Thanks for the help.


If a linear map, $φ: U→V$ is bijective, then $φ(x)=0$ has only the solution $x=0$.  "an attempt":  $$φ(0)=φ(0\cdot x)=φ(0)+φ( x)$$

Prove: If a linear map, $φ: U→V$  is bijective, then $φ(x)=0$ has only the solution $x=0$.  Either a proof or explanation will be appreciated.


I am trying to evaluate the log-likelihood of a mixture of weibull distributions and am running into problems with the numerical aspect. In short, I have $M$ mixtures and want to evaluate: $$   \log \left[ \sum_{m=1}^M \pi_m \frac{\beta_m}{\alpha_m} \left( \frac{x}{\alpha_m}\right)^{\beta_m -1} e^{-\left( \frac{x}{\alpha_m}\right)^{\beta_m}} \right] $$ with $\pi_m$ being the mixing probability, $\alpha_m$ and $\beta_m$ being parameters for distribution $m$ and $x$ being some data-point we've collected. My problem comes from evaluating the exponential term here, where I often just get 0 on my computer due to the power being very negative. I have been reading and found the 'log-sum-exponential trick' at various sources, but it is unclear to me if this is valid when we have coefficients in-front of the exponential. Is there a known numerically stable way to evaluate this, and if the log-sum-exponential trick is indeed valid, can someone show how this works with the coefficients?

I am trying to compute this posterior distribution:  $$ (\theta|-)=\frac{\prod_{i=1}^{n}p_i^{y_i}(1-p_i)^{1-y_i}}{\sum_{\text{all}\,\theta,p_i|\theta}\prod_{i=1}^{n}p_i^{y_i}(1-p_i)^{1-y_i}} $$  The problem is that the numerator, which is the product of a bunch of $\text{Bernoulli}(p_i,y_i)$ probabilities is too small. (My $n$ is large, about 1500).   Hence, the posterior values for all $\theta$ all get calculated to be 0 (I am doing calculations in R).  To clarify, each $y_i$ has its own $p_i$, together these $p_i$'s make a vector of $n$ elements for $n$ $y$'s. Each $\theta$ has its own $n$-element vector of $p_i$.  EDIT: Adding a reproducing example (for the numerator)  p <- sample(seq(0,1,by=0.01), 1500, replace=T) y <- sample(c(0,1), 1500, replace=T) dbern(y, p) # 1500-element vector, each element is < 1 prod(dbern(y, p)) # produce 0 exp(sum(log(dbern(y, p)))) # produce 0 since the sum is very negative


Let $\xi$ and $\eta$ be random variables and $\mathbb{E}\xi=\mathbb{E}\eta=0$ also $\mathbb{D}\xi=\mathbb{D}\eta=1$. Here $\rho=\rho(\xi,\eta)$ is a correlation coefficient. Need to show $$\mathbb{E}\max\{\xi^2,\eta^2\}\leq 1 + \sqrt{1-\rho^2}.$$  So, I know that $\rho=\rho(\xi,\eta)=\frac{\mathbb{E}(\xi-\mathbb{E}\xi)(\eta-\mathbb{E}\eta)} {\sqrt{\mathbb{D}\xi \mathbb{D}\eta}}$.  But how to start and what qualities to use?

I have 2 random variables $X,Y$ with mean 0 and variance 1, their correlation is $\rho$. I need to prove this inequality  $$\mathrm E\left({\max}\left\{X^2 , Y^2\right\} \right) \leq 1 + \sqrt{1 - \rho^2}$$ I need some pointers as to how to solve this problem. Thanks!


I read that the $n$-th finite difference of the sequence  $1^n, 2^n, 3^n,\dots$  is $n!$, but I'm not able to prove this. Could someone give an idea of why this is true?

Show that the $k$-th finite differences of the sequence $1^k ,2^k,3^k ,...$ are each $k!$.  I have tried but I fail when I try it proving using mathematical induction.Please help me.  Thank you in advance.


I have an old Dell laptop and had Windows 10 running on it. I wanted to give it an extended life so I installed Ubuntu 18.04.3. My laptop is updated with the most current Ubuntu OS, BUT after the new update, Firefox will load Google webpage results but NOT the actual webpage itself. That is, I can go to Google and say I search "cat videos" or "used car dealers" and Google gives me results. But if I click a link from that, that webpage more times than not will state "webpage timed out"  I have tried both sudo apt update but that one says   connection timed out could not connect to......   for everything it attempts to load. sudo apt upgrade states   Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.    I know it's not anything to do with my internet connection since we have two smartphones, an Alexa TV cube, a PS4, that's it I think. Every other connection works just fine. I do not have any custom DNS resolver setup on my router. I have Spectrum internet also.   I have not tried plugging it into the router to see if it works that way, I would like to try to resolve this issue wirelessly if possible.    My internet does state connected and I did plugin the terminal command and this is what I got.   0.c:00.0 Network Controller [0280]: Broadcom Inc and subsidiaries BCM4312 802.11 b/g LP-PHY [14e4:4315] (rev 01)  Subsystem: Dell Wireless 1397 WLAN Mini-Card [1028:000c]  kernel driver in use: wl   kernel modules : ssb,wl

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


I'm trying to connect the inner circle to the outer circle in order to close the mesh but I can't. I've tried to select the edges/vertices of both circles and press F   but that doesn't seem to work, it creates two faces, one for the inner circle and another for the outer circle.   Now I could go individually and select four vertices (two from the inner and two from the outer circle) and connect them as you normally would but that seems like a pain in the ass. I'm pretty sure there's a more efficient way of doing this, can someone tell me what's the right way of connecting the inner circle to the outer circle, in order to close the mesh? Also, why is it doing this? Shouldn't it recognize immediately that I'm trying to connect the selected circles?  Thanks in advance.

Hey I want to connect the bottom loop with the top loop so that it forms a solid.  I have tried selecting multiple vertices and pressing F but that just creates a large face which I do not want. I have tried using grid fill bu that doesn't work either. The solution that seems to work is by selecting four vertices and pressing F and then selecting the next 4 and pressing F and on and on. That just takes too long.


I can't install ubuntu 18.04 on my ASUS Vivobook S530 . How do i install ? N.B. i have a SSD and HDD running on my laptop... will it effect anything ? I want to install ubuntu in My ssd ..

I would like to see a full how-to guide on how to install Ubuntu.


I am trying to embed lucid chart and show it as a pop-up in an iframe. It is somehow not getting aligned in the center though. And it's not responsive to the varying screen sizes as well. Can anyone please help me with it? <div class="popup" style="width: 960px; height: 720px; position: relative; text-align:center;">     <iframe allowfullscreen frameborder="1" style="width: 960px; height: 720px; position: absolute; text-align:center;"         [src]="embedUrl | urlSanitizer" id= {{embedId}}>     </iframe> </div>  It's getting aligned to the right of the page and only half of it is visible as of now. CSS looks like this .popup {   position: relative; }

How can I horizontally center a
 within another
 using CSS?

Foo foo


My son is new to comuting by bicycle. He brought a brand new bike and after just one week was having problems with the brakes. He only rides approximately 6–8 miles a day. Halfords advised that his brakes need replacing. Is this right?

Just for the record, my rims are brand new (~800 km) and clean. I have a set of KoolStop salmon brake pads (actually 2 sets, .... well, front and rear).  I installed them ~600 km ago and I already had to tighten them (adjust the cable tension) twice in the rear, once in the front. And looking at the pads, the rear are obviously thinner than they were when new and same in the front (although less noticable).  The efficiency is still very good but is that kind of wear normal? what is the usual lifespan of pads like those?  I heard only good about KoolStop stuff,... so don't think it could come from the very pads. The installation was done properly too, the pads do not touch the rims at all when brakes are released (~2mm away).


I created a Connected App in a dev environment and now I need to duplicate it in a test environment. Can this be done via a changeset, VS Code, or does it need to be done manually? Thanks,

I built a changeset and I was able to include all my classes, but it was a surprise that salesforce has not provided any option to deploy a connected app.  So how do I go about deploying a connected app? Do I need to create it in every other environment?


How can I prove that $$(A\times B)\cap (C\times D)=(A\cap C)\times (B\cap D)?$$

How to prove $( A \times B ) \cap ( C \times D ) = ( A \cap C ) \times ( B \cap D )$ ?


In the computer I'm currently using, I have 2 partitions, one with Windows 10 and one with Ubuntu 18.04 LTS. In the Windows partition I sometimes use the computer as a wifi hotspot, and I was wondering if there was a way I could do that with the Ubuntu partition. My computer is a HP Pavilion Power Laptop 15-CB001LA. Thanks in advance!  Edit: What I meant was that I want to use the computer as a hotspot while still using the wifi in the computer, as in I'm browsing anything but I want to connect another device for it to be able to connect, while still being able to continue using wifi in my computer

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?


If I have a reference of type Object and I know that this is an array, but I don't know what kind of array, what is the best way to generate a nice String?  Or in other words, what is the best / nicest implementation for the following method:  private static String anyArrayToString(Object someArray) {     if (!someArray.getClass().isArray()) {         throw new IllegalArgumentException("someArray is not an array!");     }     return ???; }   I am aware of the methods from Arrays, namely Arrays.toString(int[]), Arrays.toString(double[]), etc. These do not work here because they are strongly typed and I don't feel like having a big if-else-if cascade. (although this is my plan B if no better solution can be found)  Ideally I would want a method that works on Object references such as System.arraycopy which checks dynamically if the passed reference is an array or not.  why do I not know what kind of array it is?  Because I get the object reference via reflection after iterating over all get-methods of a different object. It is part of a utility method that finds arbitrary differences between two complex objects even if these differences are nested deep.  Thank you very much.  Edit:  This is NOT a duplicate of  because here the element type of the array is unknown and we only have a reference to Object rather than some specific array type.

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


Based on MLE (Maximum Likelihood Estimator), we knew that the puprose is to maximize the likelihood function. Then how about quasi likelihood ? Is quasi likelihood just modelling between mean and variance ?

formulates Generalized Estimating Equations (GEE) as     Given a mean model, $\mu_{ij}$, and variance structure, $V_{i}$, the estimating equation is formed via:    $$     U(\beta) = \sum_{i=1}^N \frac{\partial \mu_{ij}}{\partial \beta_k} V_i^{-1} \{ Y_i - \mu_i(\beta)\} \,\!  $$   The parameter estimates solve U(β)=0 and are typically obtained via the Newton-Raphson algorithm.     Does GEE belong to  (is the maximum quasi-likelihood method same as ?) If yes, what is its quasi-likeilhood function, or does GEE maximizes some quasi-likelihood function? What does GEE "generalize"? Is  it estimating equation method for estimation?     In what sense is GEE "generalized"? Is it similar to the way in which the generalized linear model generalizes the linear model?


I'm really confused between these two. Please help.

I posted a question somewhere that said...     Can anyone tell me how I can solve this?   ...but someone edited it to...      Can anyone tell me how can I solve this?    ...and it was accepted.  That's wrong isn't it? Can someone explain how that's wrong?


In my tex file, I have images that are spaced between paragraphs. However, when I compile the file, the images come out almost all on the same page. Is there a command I can put so that the images are located on the pdf in the same place as they were (relative to the paragraphs) in the tex file?  Thank you!  Edit: Here is an example of part of the tex file. Would a \FloatBarrier before and after the image keep the image within the part of text that I want?  Example:  For notation, let `$xy$` refer to a crossing made by an x-stick and a y-stick.  We will prove this by contradiction. Without loss of generality, assume that  we have two `$xy$` crossings (the other crossings are equivalent by rotation).  (see image 1).  \begin{figure} \centering \includegraphics[scale=.2]{2new.png} \caption{Assuming we have two xy crossings} \end{figure}  We have two cases: one where the two crossings share a stick and the second  where they do not. Regarding the former, assume the crossings share an  x-stick, again without loss of generality by symmetry.

Is there any package or a method to force LaTeX to keep floating environments like table and figure closer to where they are declared?


I have this laptop:  It came with a pretty large and heavy power supply, so I am trying to replace it with a smaller one. The reason why it's so heavy is because it outputs 19.5V at 7A max. That's a lot of power. I plugged my laptop to a desk power supply and measured the current going in at 19.5V when I simultaneously copy file from partition to partition, download from the internet and play a very demanding video game engaging the NVidia graphics card. Maximum input was 4A - it never peaked over it. When the graphics card is not engaged, the input is about 1.5A. My question is, is it safe to replace the power supply with one that outputs maximum of 19.5V at 5A? What happens if, theoretically, the current draw is momentarily higher than 5A? I guess it would just turn of charging of the battery and start sucking the extra needed power from the battery, right? In other words, I should be safe using a lower amperage power supply, correct? I want to make sure my logic is sound before I do this. Thank you!

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


I am planning to invest some extra income I have. I am thinking of maxing out all my retirement accounts before I look into other investment opportunities. I am having some difficulty identifying which ones I can contribute to. It would be great if somebody here could help me here.  Currently I am on track to max out my employer sponsored 401K. I was under the impression that my contribution plus employer contribution should not exceed the maximum limit of $18K. However, I am told by my employer that I can contribute the maximum of $18K and employer match can add on top of it. Essentially, the total contribution can exceed $18K, is this correct.  I also make some money through my personal business. Can I open a separate individual IRA and contribute another pretax $5,500?  On the same note, can I also open a Roth IRA and contribute another post-tax $5,500?  In the nutshell, if I can contribute as mentioned above, I will be contributing as follows.  401K (pre-tax) => $18K + employer match  Individual IRA (pre-tax) => $5.5K  Roth IRA (post-tax) => $5.5K  Is this correct? Am I missing any other opportunity that I haven't mentioned above?  Thank you

Are the $18,000 401(k) 2017 limit and the $5,500 IRA limit mutually exclusive for a combined limit of $23,500 (under 50)?   Or are they inclusive, meaning $5,500 in an IRA, would limit a 401(k) to $12,500?  I'm also assuming employee matching count towards these limits. Is this correct?


I have an array like this: const arr = [1,2,3,4,5]  I want to achieve something like this: let answer = 1,2,3,4,5  I want the typeof answer to be a number.

I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate through the array and build the string myself by concatenation if that's the only way.)


Is there any SQL query to delete all rows from all tables in postgresql?

I have created a fresh db dump from a production server with the --data-only and --column-inserts flags, so I only have a bunch of insert statements to insert data when performing a restore on a staging server.  pg_dump -h localhost -U adminuser --data-only --column-inserts maindb > maindb.sql   How do I delete all data in the staging server database first, before restoring the data from the production dump?   I want to delete all data only so I don't have to drop and create the database and all that stuff. I just want to remove data and insert new data that is all.  I don't have the option to drop and create the database for several reasons. I will have to remove all data and just insert only, so whatever it takes to find how to do this, am willing to go for it but need help obviously to start with.  I also need to automate this process. Will automate "dumping data from production db", then "deleting data on staging db", and then "restoring data to staging db". I just need help on the "deleting data on staging db" part.  I am running on PostgreSQL 9.5.2


Show that  $$\lim_{n\to\infty} 2n(a^{1/(2n)}-1)=\log(a)$$  is true for $a > 0$.  I am really stuck on this task.

lists this as a limit representation of the natural log:  $$\ln{z} = \lim_{\omega \to \infty} \omega(z^{1/\omega} - 1)$$  Is there a quick proof of this? Thanks


I'm looking for a word that describes when you learn a new word (or phrase or song) and then hear it all over the place. My daughter did not recognize either the melody or the name of the song The Girl from Ipanema. After playing it once (and watching this Adam Neely video, ), she began to recognize it in many novel contexts. Indeed, she couldn't unsee it. This is different from déjà vu (where you falsely recognize something) and jamais vu (where you don't recognize something familiar). I'd be happy with either a verb or a noun. Obligatory fill-in-the-blanks:  I learned the word schadenfreude and now I _____ (verb) it everywhere.   Never hearing the song, I saw a documentary on The Girl from Ipanema and now have a sense of ______ (noun).  I had a prof who was fond of saying, "When you build a better hammer, it's surprising how many things start to look like nails." This word should entail the concept of the transition from unrecognized to recognized, unfamiliar to familiar, once looking not-like-nails, now looking-like-nails.

For example, when you buy a car, you start becoming more aware of cars with a similar make and model. The number of that type of car hasn't increased, but your awareness of it has.  Similarly, when you learn a new word, you start hearing the same word used in different places. You probably just filtered the word out previously, but now you've become aware of it.   How do you describe the phenomenon when you become more aware of something after an initial or significant exposure or experience with that thing? What term or word can you use?


I am travelling from OR Tambo International, Johannesburg South Africa on Virgin Airlines on 15 December 2017, arriving at Heathrow 16 December 2017.  Three hours there and then on to Cork with Aer Lingus.  Can I book my bags in at Johannesburg to go straight through to Cork (although I travel with two different airlines) and do I need a in transit visitors visa at Heathrow?  Also departing 2/1/18 from Cork to Heathrow with Aer Lingus and 5 hours then I board Virgin Airlines to South Africa.  Same questions.

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


$f$ holomorphic at $B(0,1)$ and $|f(z)|<1$ for every $z\in B(0,1)$ and $f(z)=z$ has at least two solutions in the domain Prove for every $z\in B(0,1)$ $f(z)=z$. My try: Setting $f(z)=zg(z)$ and taking $r<1$ and looking at $|z|=r$ we can deduce that $|g(z)|<\frac{1}{r}$ by taking $r\to 1$ $|g(z)|<1$ and because $f$ has at least two solutions and we can take $z_0\neq 0,f(z_0)=z_0$ we get that $z_0g(z_0)=f(z_0)=z_0$ therefore $g(z_0)=1$ in contradiction to the assumption of $g$ and from MMP we get that $g\equiv 1$ and $f(z)=z$ for all $z$ in the domain

This is from an old qualifying examination question.  If f is holomorphic in the unit disk $D$ and $|f(z)|<1$ for all $z\in D$. Suppose also that $f$ has two distinct fixed points in $D$ then $f(z)=z$ for every $z\in D$  I know that I have to use the Schwarz's lemma and may be make use of Möbius transformations. I tried setting $g(z)=\phi_a\circ f\circ \phi_{-a}$. But that does not seem to work because I don't see why $|g(z)|=|z|$ for some non zero $z$.   Any helpful hints are greatly appreciated.  Edit: Of course the $a$ above is one of the fixed points.


I want to stay in the UK for 6 months on a tourist visa. Then I will leave and return for another 6 months. What is the minimum time I must be out of the country before re-entering?

I am a Chinese citizen holding a HK SAR passport. How long am I able to visit the UK within a 365-day period?  My stamp is for 6 months. Could I leave within 6 months but re-enter again a couple of weeks for another 6 months?


I kind of barely understand this in some way, and I think I would understand it better by a formal proof. Where do I start?

I am trying to calculate the following limit  $$\lim_{N\to\infty} \frac{N!}{(N-k)!N^{k}}$$ where $k$ can be any number between $0$ and $N$.  I thought of the following:  If I take the logarithm of the expression then I get:  $$\lim_{N\to\infty} \left(\log(N!)-\log((N-k)!)-k\log N\right)$$    Using the Stirling formula this can be approximated as:  $$\lim_{N\to\infty} \left(N\log(N)-(N-k)\log(N-k)-k\log N\right)$$  Now there are two cases: If $k$ is $N$, then the second term vanishes and the remaining terms cancel. If $k$ is smaller than $N$, then I can drop the $k$ inside the second logarithm and all the terms cancel. So the limit $$\lim_{N\to\infty} \log\left(\frac{N!}{(N-k)!N^{k}}\right)=0$$ Which means that: $$\lim_{N\to\infty} \frac{N!}{(N-k)!N^{k}}=1$$ I don't know if this is mathematically rigorous. Would like some help. Thanks


I have the following code.  import java.util.Arrays;  public class Practice {        public static void main(String[] args) {         System.out.println(checkEquality({1,2,3},{1,2,3}));     }      public static boolean checkEquality(int[] a, int[] b) {         return  Arrays.equals(a,b);     } }   I am trying to write a method that checks for equality between two arrays of type int. The code as written doesn't compile, giving me an illegal start of expression error for line 11 (the one which has the print statement). However if I first define two arrays in the main method  int[] a= {1,2,3}; int[] b= {1,2,3};   and then change   System.out.println(checkEquality({1,2,3},{1,2,3}));   to System.out.println(checkEquality(a,b));  the code compiles and works as it should, giving me true.   My question: why can't I input the two arrays that I want to check for equality directly into the print statement? This has worked with all other methods that didn't have array, ex expressions involving integers and strings.  Am I doing something wrong here or is this generally not possible? If so, why?

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


Consider a ball that strikes a stationary box and has momentum $mv$. If the ball rebounds with the same speed it had before the collision, its momentum is $-mv$. Therefore, the box must have a momentum of $2mv$ in order for momentum to be conserved. However this would mean the kinetic energy after the collision is more than the kinetic energy before the collision. Where would this energy come from, or is the situation I described impossible?

Yesterday, while studying a simple question, a rather strange doubt hit my mind:     Consider a ball of mass $m$ moving with velocity $v$ that collides with a wall in a perfectly elastic collision and rebounds back with the same velocity. Taking the direction of initial motion of the ball as positive, the change in momentum of the ball is $-2mv$ and the wall is clearly at rest.   So, in order to obey the law of conservation of momentum, the wall must gain a momentum of $2mv$.  Now, this itself confused me a lot. I then applied the law of conservation of kinetic energy to this situation, and clearly the magnitudes of the initial and final velocities of the ball are equal, so kinetic energy of the ball is conserved and hence the final kinetic energy of the wall must be zero in order to conserve energy.  Now, this contradicts with the law of conservation of momentum, which says that the wall must gain momentum of $2mv$.  One more point: If we are talking about a wall then it is an important fact, which must be considered, that the wall is fixed on earth and so the mass of the wall is equivalent to that of earth, say $M$. If the law of conservation of momentum is applied now then we get velocity of the wall, say $V=2mv/M$ which is no doubt an extremely small value. But, the law of conservation of energy strictly says that the velocity of the wall must be exactly zero, not even the smallest value is allowed (theoretically speaking).   Please clarify this and correct me anywhere if I'm wrong. I have tried my best to make it clear what I want to ask :).


I plan to self-learn Algebraic Geometry. I have an undergraduate degree in Math. I cannot find a clear answer on what the clear textbook could be. There are also some notes online on the subject, like Gathmann and Milne.

Lifted from :  I think (almost) everyone agrees that Hartshorne's Algebraic Geometry is still the best. Then what might be the 2nd best? It can be a book, preprint, online lecture note, webpage, etc.  One suggestion per answer please. Also, please include an explanation of why you like the book, or what makes it unique or useful.


I'm not much of a networking guru, but I'm needing to conduct an experiment to see why some RSLs are not loading on some client computers when they try to load a swf off of their intranet's server.  I'm tempted to believe this is the result of their inability to access adobe.com to download the RSLs.  However we have seen these same swfs work on other computers that are kept away from the Internet, and my theory here is that this is simply due to the RSLs being cached a while back inside of their Flash Players.  To test the theory, I'm wanting to completely block *.adobe.com from my computer, so as to avoid being able to download RSLs from their website.  Then I want to completely uninstall, then reinstall Flash Player, then load the swf from one of our own servers.  I am NOT able to manipulate hardly any of our own networking at all.  I can use Windows Firewall, but that doesn't appear to be able to block specific sites.  I have tried adding this site to things like the Restricted Zone in IE, but I'm still able to visit the site just fine for some reason.  There is no reason this should be so difficult.  Any ideas?  Thanks!

For privacy and performance reasons, I'd like to prevent my computer from ever communicating with certain Internet hosts. I'd like to do this at the OS level, not through web browser plug-ins (not broad enough), or even through my home router (my laptop travels). I'd prefer to use built-in tools.  I'm running Windows 7 Professional 64-bit. I'm all too familiar with the Windows hosts file - and its limitations. There seems to be some confusion over whether hosts supports wildcards, but my own tests confirm that it does not.  I have experimented with Windows Firewall and the IP Security Policy MMC snap-in. So far as I can tell, both require numeric addresses. I don't want to block specific IP addresses, or ranges of addresses, in part because IP-address-to-hostname mappings can and do change.  Is there any tool in Windows 7 Professional with which I can block (or route to 0.0.0.0) communication with Internet hosts by hostname mask? If not, are there any good, free, third-party tools?


I suggest creating a definite list of guidelines for when to migrate questions from one site to another and adding it to the Community Wiki. I didn't find it in one place.  If I'm wrong, please point me to that place.

I posted a question which was closed as off-topic and it seems like it could fit on another site in the network. How can I go about moving it there?   What is migration? When can a question be migrated, and who can migrate it? When should I consider migration, and when is it inappropriate? What causes a migration to be blocked and what happens after? What causes a migration to be rejected and what happens after? Anything else I should know about migration?


guys please help me to boot windows 10 first instead of Ubuntu. I tried using boot repair but it didn't work. The URL generated by boot repair is mentioned below

In Ubuntu 12.04 (or above), how do I set the GRUB time and the default OS (that I see at boot time) as I'm dual-booting Windows (7/8) and Ubuntu (12.04 or above)?


I'm completely lost. I use LaTeX, but not competently. I want to do a bibliography and in-text citations in APA style.  I downloaded JabRef and did a test entry. Then I wrote the following code:   \documentclass{article} \usepackage{apacite} \bibliographystyle{apacite}  \begin{document}  \bibliography{testname}  \end{document}   ...where testname is the name of my BibTeX file. My reference does not appear when I do this, though it does say "reference." I'm using TeXstudio, in case anyone is interested.  So, what do I do? Can someone explain to me in super simple terms how to get my entries from JabRef into an APA-style bibliography/in-text citations in TeXstudio?

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


I have a power supply which is 19.5V and 6.15A. My friends power supply or laptop probably broke and his power supply has a 19V and 6.32A. His charger comes with an adapter which fits my plug perfectly, would it hurt if we tested my charger on his laptop?

I have a Toshiba Satellite laptop. My charger has stopped working.  I have access to a Lenovo charger. Can I use this charger on my laptop?


Is there a way to re-render my VF page when a field is modified via inline editing without anything being saved? Right now I have the following snippet in my VF page:  <apex:outputField value="{!qli.Quantity}">                         <apex:inlineEditSupport event="ondblclick"/> </apex:outputField>   I can double click on this field to change its value, then click outside of it to set that new value. At that point, nothing has actually been saved, but the new value I typed in is displayed in that outputField.  As soon as that field is modified, I would like to rerender a section of the page.  I tried using apex:actionsupport in my outputField with an "onchange" event, but it didn't work.  <!-- this does not work --> <apex:outputField value="{!qli.Quantity}">     <apex:actionSupport rerender="qliList" event="onchange" immediate="true"/>     <apex:inlineEditSupport event="ondblclick"/> </apex:outputField>   Is there a way to do this? I tried a few different hacks to make this work such as trying to attach an event listener to the field in Javascript, but Salesforce make this basically impossible since they change the id and class attributes of the element. I don't know of a reliable way to pull these elements in javascript to attach an event listener to them, and theres the further challenge of actually triggering a page re-render from JS which I'm not entirely sure how to do...  My problem cannot be solved by the solution offered by Shailendra Singh in    Inline editing can only be done with outputfields. I specifically need an outputfield to use this feature. Inputfields are always editable, whereas outputfields are not editable by default unless they have inline editing enabled, at which point the user can double click on them to enable editing and change them. The solution Shailendra Singh offered in that other question involves changing the field from an outputfield to an inputfield, which is not what i need.

I have a picklist type outputfield on my visualforce page, i want when i select any value from this field some field will hide as per selected value.  <apex:outputField value="{!oFormobject.C_Item_Married__c }" rendered="{!CONTAINS(sApiName, 'G2C_Item_Married__cN')}">           <apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick"/>           <apex:actionSupport event="onchange" reRender="personalInfo" /> </apex:outputField>   Thanks in Advance.


i'm tring to implement In App Billing into my application. I wrote this code.  public class Settings extends PreferenceFragment {      ServiceConnection mServiceConn;     IInAppBillingService mService;     PendingIntent pending;     Intent intent;     Bundle bundle;      @Override     public void onDestroy() {         super.onDestroy();         if (mService != null) {             getActivity().unbindService(mServiceConn);         }        }      @Override     public void onCreate(Bundle savedIstanceState) {         super.onCreate(savedIstanceState);         addPreferencesFromResource(R.xml.settings);          getActivity().getActionBar().setTitle(getString(R.string.settings));           mServiceConn = new ServiceConnection() {                 @Override                 public void onServiceConnected(ComponentName arg0, IBinder arg1) {                     // TODO Auto-generated method stub                        mService = IInAppBillingService.Stub.asInterface(arg1);                 }                  @Override                 public void onServiceDisconnected(ComponentName arg0) {                     // TODO Auto-generated method stub                     mService = null;                 }             };              intent = new Intent("com.android.vending.billing.InAppBillingService.BIND").setPackage("com.android.vending");             getActivity().bindService(intent, mServiceConn, Context.BIND_AUTO_CREATE);              try {                 bundle = mService.getBuyIntent(3, getActivity().getPackageName(), "pro_version", "inapp", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");                 pending = bundle.getParcelable("BUY_INTENT");                 getActivity().startIntentSenderForResult(pending.getIntentSender(), 1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));             } catch (RemoteException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             } catch (SendIntentException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             }      }  }   When i launch the application and open this Fragment the app crash with this error:  01-31 19:59:30.969: E/AndroidRuntime(11546): java.lang.NullPointerException: Attempt to invoke interface method 'android.os.Bundle com.android.vending.billing.IInAppBillingService.getBuyIntent(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String)' on a null object reference   In the AndroidManifest obviously i've these permissions:   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>       <uses-permission android:name="android.permission.INTERNET"/>   <uses-permission android:name="com.android.vending.BILLING"/>

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


I need to remove all punctuation marks in the string, as a part of bigger program.  It is working when I write it serepatly for each mark like this:  words = [word.replace(".", "") for word in words]   But when I am trying to do it in the loop, it is not working.   line = "I was going to leave her, but in the very last moment I had changed  my mind. Interesting thing, many nice ways to use." words = line.lower().split() for punc in [".",","]:     if punc in words:         words = [word.replace(punc, "") for word in words] print words   Can you please tell me, what I am doing wrong?

It seems like there should be a simpler way than:  import string s = "string. With. Punctuation?" # Sample string  out = s.translate(string.maketrans("",""), string.punctuation)   Is there?


I've been using Ubuntu for quite some time now but I need to shift to Windows and I need the SSD which Ubuntu is taking. I have set up a dual boot option, one SSD is Windows 10 and the second is Ubuntu. I want to remove Ubuntu and be able to add that SSD to Windows 10 if that's possible without reinstalling Windows.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


What is the proper way to measure how much memory from the heap should be used to create new object of a certain type (let's talk about Integers to keep it simple)?  Can this value be calculated without experiment? What are the rules in that case? Are these rules strictly specified somewhere or they can vary from jvm to jvm?

Is the memory space consumed by one object with 100 attributes the same as that of 100 objects, with one attribute each?  How much memory is allocated for an object? How much additional space is used when adding an attribute?


I want to take time difference of two time stamp but getting an error while passing timestamp variable from shell toawk.  Shell code:  FTIMESTAMP="2015-07-01 12:30:50" gawk -v FTIMESTAMP=$FTIMESTAMP -v DSECONDS=$DSECONDS -f test.awk /home/abc/TShift.csv    Error is:  gawk: 12:30:50 gawk:   ^ syntax error   Escaping character is also not working FTIMESTAMP="2015-07-01 12\:30\:50".  I have another timestamp in awk and want to take time difference between them.

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?


I can't believe this bug has still not been solved with Ubuntu 14.04 ? On my 2 laptops, Acer and Asus, on a random basis, the keyboard layout switch from FR to EN.  This is very frustrating when you type a password and can't see the letters.  How to solve that for good ?

I had a problem with the keyboard layout changing from PT (I'm Portuguese) to EN automatically with the last Ubuntu updates in Ubuntu 13.10. After Ubuntu 14.04 came out, I formatted my computer and installed the new version.  After that I haven't had any problems until the recent Ubuntu base update 2 or 3 days ago, when I started having the same problem again. I even removed the English keyboard from the Keyboard configurations, left only the Portuguese one, but still, every time I reboot my PC I get the keyboard configured for EN, despite Ubuntu displaying the contrary?  How can I remove this? I don't want to format the PC again and I'm getting really tired of this problem, since it looks like many Portuguese/Brasilian Ubuntu users are having the same problem.