I am trying to build VLC player on Ubuntu 14.04.  It's been a tough road but I am learning along the way. However I am really stuck with this lib libavcodec that is required as prompted by this message.  configure: error: Requested 'libavcodec >= 57.16.0' but version of libavcodec is 54.35.0. Pass --disable-avcodec to ignore this error.   What I don't understand is why apt does not have libavcodec above 54. Is this a common issue where libs are updated, but not on apt? If so how do I got about getting the version I need?


How can I get colored folders back in Mavericks?

With the launch of the new tagging system in OS X Mavericks, the ability to color the actual folder line in the finder appears to be gone.   Is there anyway to bring this back??


I started wondering why floating numbers sometimes behave in such a strange way. I found out that it is because a number has to be represented with either 32 or 64 bits, so at some point the number needs to be simplified and rounded up.  So I experimented a bit on Python to get a better idea of how floats behave:  1-0.000000000000000001 == 1 returns True as expected.  However 0.000000000000000001 == 0 and 0.9999999999999999 == 1 return False.   Remarkably 1-0.000000000000000001 == 0.9999999999999999 also returns False  Is there something I am missing?


Wouldn't it take an infinite amount of time to create an infinite universe?

I have heard many people say that the universe is possible infinite. But, if it takes time and energy to create bodies such as planets and stars and the universe has only existed for 13.7 billion years how could there be enough time to create something that is infinite in size. Is my logic flawed?


List difference with list constructed by Arrays.asList has surprising result. Why?

What value for "zs" do you expect after the following snippet has run?   Collection<Integer> xs = Arrays.asList(1,2,3); int[] ys = {1}; List<Integer> zs = new ArrayList<>(xs); zs.removeAll(Arrays.asList(ys));   I would have expected a list containing 2 and 3. However, with JDK 1.8.0_25 in Eclipse 4.5 M7 it is a list containing 1, 2, 3. The removal has no effect. However, when I specify "ys" as a non-primitive array, I get the expected result:  Collection<Integer> xs = Arrays.asList(1,2,3); Integer[] ys = {1}; List<Integer> zs = new ArrayList<>(xs); zs.removeAll(Arrays.asList(ys));   What's going on here?


Exception in thread "main" java.lang.NullPointerException . nothing seems to work

i keep getting this one error, and im unsure how to change the code to get rid of this error. nothing seems to work.what would be the way to get rid of this error?  import java.util.*; import java.io.*;  public class string2 {     public static String getInput(Scanner in) throws IOException {         File dataFile = new File("data.txt");         String input = null;          if (!dataFile.exists()) {             System.out.println("Error");             System.exit(0);         }         return input;     }         public static int getWordCount(String input) throws IOException {         String[] result = input.split(" ");         return result.length;     }           public static void main(String[] args) throws IOException {         String input = getInput(new Scanner(System.in));          int counter = getWordCount(input);         System.out.println("The number of words in this string (" + input + ") are: " + counter);     }    }    xception in thread "main" java.lang.NullPointerException     at string2.getWordCount(string2.java:40)     at string2.main(string2.java:51)


Why does the Moon have circular motion while a falling apple has one-dimensional motion?

An apple and the Moon are both attracted to Earth. So why does the Moon have circular motion while an apple has one-dimensional motion?


Javascript one argument in function definition, but two arguments given

I am reading about closures right now and am confused by this javascript code.   function makeAdder(x) {   return function(y) {     return x + y;   }; };  var add5 = makeAdder(5); var add10 = makeAdder(10);  console.log(add5(2));  // 7 console.log(add10(2)); // 12   How does the console.log work? Since add5 = makeAdder(5), then isn't add5(2)) = makeAdder(5)(2)?    I am wondering how y = 2 is determined by javascript in this function, as the function only defines one argument x.  EDIT: Sorry to make it clear, what I was confused about was the fact that it appears like 5 and 2 are both being passed into makeAdder(x).


How to get back to original spawn when in creative and spawn resets?

I made a really good castle in creative mode but had not slept in a bed on superflat mode. Someone killed me and that somehow reset my spawn more than once. I did tests in a new world of the same kind of circumstances and found that when killed and not having slept in a bed you respawn in a totally different area. If anyone knows how to get back to my original spawn point I would really appreciate the help.


How to execute sp_send_dbmail while limiting permissions

Is there a way to provide access to users in my database to execute  msdb.dbo.sp_send_dbmail without needing to add them to the MSDB database and the DatabaseMailUserRole?  I've tried this:  ALTER PROCEDURE [dbo].[_TestSendMail] (   @To NVARCHAR(1000),   @Subject NVARCHAR(100),   @Body NVARCHAR(MAX) ) WITH EXECUTE AS OWNER AS      BEGIN         EXEC msdb.dbo.sp_send_dbmail @profile_name = N'myProfile',             @recipients = @To, @subject = @Subject, @body = @Body     END   But I get this error:  The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.   Thanks!


How do I test for a player at specific coordinates?

If I do:  /testfor @p[x=,y=,z=,r=]   It says:     The entity UUID is in an invalid format.


TF-IDF vs just TF in text classification

It's common to see people using a tf-idf representation of words for text classification, but I don't understand why not just use tf.  Say $tf(t,d)$ is the $tf$ of term $t$ in a document $d$ and $idf(t)$ is the $idf$ of term $t$. $idf(t)$ will be the same for every document, so it is just a number by which we multiply every $tf(t,d)$. If we fit a linear model, for example, won't multiplying the $tf(t,d)$ by $idf(t)$ just shrink the learned weights by $idf(t)$? If we further normalize or standardize the columns, won't the two representations end up being the same?  I saw , but I'm not sure if I agree with the accepted answer. It argues that better features help learning, but it doesn't explain how this factor effectively leads to better features when we deal to models invariant to scaling.


I'm trying to work out sum of this series $$1 + \frac{2}{2} + \frac{3}{2^2} + \frac{4}{2^3} + \ldots$$  I know one method is to do substitutions and getting the series into a form of a known series. So far I've converted the series into $$ 1 + \frac{2}{x} + \frac{3}{x^2} + \frac{4}{x^3} + \ldots  $$ where $x=2$ and I'm trying to get it into the form of the $\ln(1+x)$ series somehow. I have tried differentiating, integrating and nothing is working out. The closest I got is by inverting which gave me $ 1 + \frac{x}{2} + \frac{x^2}{3} + \frac{x^3}{4} \ldots $   Now I'm just lost and have no idea what to do.  The other idea I had was converting it into $$ \Large{\sum_{n=1}^\infty{\frac{n}{2^{n-1}}}}, $$ but I have no idea how to do anything further to it. How would you do this? Thnx.


Number of points lying on a line in a projective plane of 7 points

Does every line in a projective plane of $7$ points have exactly three points lying on them? This was my attempt, it seems to me that this fact is true. Could anyone verify it or provide any other proof/counterexample(if there are any) ? Call that projective plane $P$. First of all a line in $P$ cannot have all the seven 7 points lying on them as that would contradict the axiom that "there exists three non-collinear points in every projective plane". A line in $P$ can also not contain $6$ points, as if it were, then the the other point call it $X$ would be arbitary and any line joining $X$ and one of the points among those $6$ will not contain atleast three points because there are only 7 points in $P$ and thus would contradict the axiom that a line in a projective plane conists of atleast three points. With a similar reasoning we can show that a line in $P$ cannot contain $4,5$ points, thus there are always $3$ as there cannot be less than $3$ points lying on a line in a projective plane. Thanks!


(In the US, just to clarify)So, from a physics perspective weight and mass are different, but when people are talking about weight in everyday(non-physics) situations ("how much do you weigh" etc.), are they actually talking about mass and it's just common to refer to it as 'weight'?  Expanding on that, when you step on a scale, i've read it displays your mass(after conversion from weight as it's displaying the "results"). Seeing as pounds is a measurement of weight, why will it use pounds as a unit of mass?  Maybe i'm getting things completely confused, any help is appreciated.


Update LibreOffice 4.2.4 in Ubuntu 14.04 LTS Trusty

LibreOffice have update into minor release 4.2.4. How to update them? I have seen the package list in Launchpad at LibreOffice PPA, but it's still not available until now (still 4.2.3 rc3).


Can I use "therefore", "so", "hence" and "thus" interchangeably?

I was taught that, at least, 'therefore' and 'so' and can be used interchangeably, one being informal, the other formal. But, even when written, replacing 'so' with 'therefore' doesn't seem correct.     I was tired so I fell asleep.   ...     I was tired therefore I fell asleep.   Am I even allowed to use therefore as a conjunction here? The dictionary says I can, but it would seem more suitable to say:     I was tired and therefore I fell asleep.   I realise hence and thus (and even ergo) are rarely used, but where do they fit into this?


I have the following string:  s = '''     Gus’s World Famous Fried Chicken     South City Kitchen - Midtown '''   I am trying to match both groups between the s  using the following  regex = re.compile('<a class="biz-name[\w\W]*(.*)') regex.findall(s)   expected:  ['Gus’s World Famous Fried Chicken', 'South City Kitchen - Midtown']   actual  ['South City Kitchen - Midtown']   Why is only the last occurrence being matched?


Does the direction of travel matter for jet lag, when the time difference is 12 hours?

I was having a discussion with a friend about this. Usually, I understand that when traveling east, jet lag is worse than when traveling west.   However, when the time difference is (about) 12 hours, I posed that there would be no difference, as the directionality of the time shift makes no difference to the time of day at your destination (3 PM +/- 12 hrs is 3 AM, the only difference is the date).   My friend countered that it's not the time difference at the destination per sé that makes the difference, but the length of daylight during the flight. When traveling east, you'd fly into the sun, which would cause your perceived days to be compressed. When traveling west, your day would be extended. In their view, this made the difference.  I'd like scientifically sound proof of either one of these hypotheses, but personal experience is also much appreciated.


Prove the inequality $\frac{a}{c+a-b}+\frac{b}{a+b-c}+\frac{c}{b+c-a}\ge{3}$

Let a, b, c be the three side lengths of a triangle. Prove that  $$\frac{a}{b+c-a}+\frac{b}{a+c-b}+\frac{c}{a+b-c}\geq 3$$  Under what conditions is equality obtained?


I'm trying to copy over a question from my math homework to LaTeX, and can't figure out how to replicate this box between $G_1$ and $G_2$:     I've tried \qed, but that is always preceded with a space:   I've tried \fbox{}, but it is too low in the line:   How do you think my professor achieved the box?


How to prove $\text{Rank}(AB)\leq \min(\text{Rank}(A), \text{Rank}(B))$?


can anyone help me with this:” I shivered and sweated ______ .” I’m wavering between “continuously” and “ continually “. I googled it and found that the answer is “ continually “ but my teacher said the correct answer  is “ continuously “. pls tell me which one is correct and enlight me on the difference between them. thanks in advance and sorry for my terrible english


How do I specify the file path for a connected android device in a command prompt on a windows 10 operating system?


I'm banned from asking questions, could you give me some advice?

I'm always trying edit to make my questions better, but it seems it's not working so well.  Could you give me some advice on how I can improve my questions?  ...  Well, I'm banned again, help...  I've delete some of my poor questions.


Why we cannot use Gauss's Law to find the Electric Field of a finite-length charged wire?

One of my physics books has a nice example on how to use Gauss's Law to find the electric field of a long (infinite) charged wire.  However, at the very end of the example, the author ends by saying Gauss's Law cannot be used to find the electric field of finite-length charged wire.  I could not understand why not.    Please this is not a homework problem or nothing like that. This is just a question I have and I have not being able to solve it in my mind yet.


I messed up and now terminal closing itself as soon as I open him. I wanted that terminal execute command when it's starts, but I haven't noticed "when command exits" was "close terminal". Now it's closing itself as soon as I open it. How to fix? Reset terminal settings?


Showing Parallelism is an equivalence relation in $\Bbb R ^2$

Let $L$ denote the set of all lines in the Euclidean plane $\Bbb R^2$. We say that two lines $L$ and $M$ are parallel if either $L = M$ or $L$ and $M$ have no points in common.  Using Euclid’s Parallel Postulate prove that parallelism is an equivalence relation on the set $L$.  I need some help determining if I have the right idea about this.  $L=L$ which means that $L$ is parallel to itself. So this is reflexive.  Suppose we have $L || M$. Then Either $L=M$ or $L$ and $M$ share no points. So Then $M=L$ or $M$ and $L$ share no points. Then $M||L$. So this is symmetric.  Suppose we have $L || M$ and $M || N$. So then either $L=M$ or $L$ and $M$ share no points and either $M=N$ or $M$ and $N$ share no points. So we have that either $L=N$ or $L$ and $N$ share no points. So $L || N$. So then this is transitive.  So from all of this, parallelism is an equivalence relation. I'm not sure if this is correct or not. Any help would be appreciated.


Improvements on StackOverflow frontend & user experience

My idea  I'm a new user to stackoverflow and I'm loving  the usage of tags to filter questions. This feature is really good because of the huge amount of information the users post dialy, however I've found out that is somewhat tedious to filter each tag I don't want to see.   I mean taking into consideration the fact that SO has around 24.150 tags and 227,182 questions it's just A LOT of information.  So how about instead of having to write the tags on the sidebar or the user profile we add small icons to the tags?  This would allow faster navigation and make it a lot simpler for users to understand and use SO. Allowing faster filtering and navigation to improve the user experience.  Here's a little example of what I'm talking about:  This way you can filter everything way faster than using the sidebar, thus improving the user experience and allowing the users to focus on the information they really need.  So what do you think of this idea?


Can the upvote and downvote counts be shown separately?

Sometimes I felt just total vote count do not represent the whole scenario(liking/disliking) of the community. In case of mine, my  got upvoted 5 times and downvoted 4 times. But the total vote, 1 does not represent so many difference of opinions in the community. So, can the upvote and downvote counts be shown separately? The sorting still will be on the total votes. But the numbers will show more information.


Unable to catch SQLException . After upgrading same code. Java6 to 8

We have AWT based application fetching values from DB. Doing upgrade Java6 to 8. At one place in application, we are trying handle exceptions as below -   This part works well for Java6. However for Java8 the if condition is failing even though SQLState ="23000" and VendorCode=2292. I debug in eclipse and got the values at runtime.  One more thing I would like to add; In Java8 I am getting SQLIntegrityConstaintViolationException. However I hope that is not related or causing issue.   catch (SQLException ex)         {          if ((ex.getSQLState() == "23000") && (ex.getErrorCode() == 2292))          throw new PersistentValidationException("DBCustomer: Delete restricted",ex);         else          throw new PersistentUIException("   DBCustomer:delete --- " +             "SQL error occurred.",ex);     }   Any suggestions


Is it safe to use one sample-t test with a dataset of size 5000 while the population distribution is not normal?

I have a random variable X, number of hours that kids from 10-12 years old spend on video games in one month in a specific country, and I want to test the hypothesis that the mean of my population  $u_{x}$ is higher than 50hours. I have a sample with size 5000 where each data point shows me the number of hours that a different kid (10-12 years old) spent on video games. I constructed my hypothesis as $H_{o}: u_{x} = 50$ $H_{a}: u_{x} > 50$ To test this hypothesis, I want to use one sample t-test because I don’t know the population variance. I know that one of the assumptions of t-test is that the population should have a normal distribution. When I draw the distribution of my sample, I have the below plot.  When I run Shapiro-Wilk Test for normality usin my sample, I reject the null hypothesis, my sample is not drawn from a population with a normal distribution. Under these circumstances shouldnt I use one-sample t-test but rather should I use a non-parametric test, if so which test (maybe Wilcoxon Rank Sum test)? Or since I have a sample size 5000, can I simply ignore the normality assumption and continue with one-sample t-test (from  discussion, I feel like continuing with t-test is still safe)? Thank you!


Which one of the following is correct?        Allen is one of the few people who understands the importance of hard work.   Allen is one of the few people who understand the importance of hard work.      Does understand(s) refer to Allen or to the few people?


Why can I make an edit that is visible immediately but approving someone else's edit requires other people to approve it?

I was about to make an edit to a page, noticed it had a pending edit that did the same thing and approved it.   However, for it to be visible, it requires another approval.    What is the logic behind the difference in requirements for different ways for me to change the content of a question?  Also, after I approve an edit, I don't seem to be able to edit the question directly any longer -- at least not until after the edit is approved.


I can't download Java or WINE due to similiar error

I've been trying to download Java Oracle 8 and WINE and I keep getting the same problem.      W: Failed to fetch   Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)   I get this when I try installing both and I've been searching for a solution, but I can't find one. Then there's this problem:     dpkg: error: failed to open package info file `/var/lib/dpkg/available' for reading: No such file or directory   What's that mean and ho do I fix it?    Ok, it doesn't show that error anymore, thank you to all of you. I really appreciate the help. I have a next question though...  You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies:  liboxideqtcore0 : Depends: oxideqt-codecs (= 1.0.0~bzr501-0ubuntu2) but it is not going to be installed or                             oxideqt-codecs-extra (= 1.0.0~bzr501-0ubuntu2) but it is not going to be installed  wine1.7 : Depends: wine1.7-amd64 (= 1:1.7.19-0ubuntu2~trusty2) but it is not going to be installed            Depends: binfmt-support (>= 1.1.2) but it is not going to be installed            Depends: wine1.7-i386 (= 1:1.7.19-0ubuntu2~trusty2) but it is not installable            Recommends: gnome-exe-thumbnailer but it is not going to be installed or                        kde-runtime but it is not going to be installed            Recommends: ttf-mscorefonts-installer but it is not going to be installed            Recommends: fonts-horai-umefont but it is not going to be installed            Recommends: fonts-unfonts-core but it is not going to be installed            Recommends: ttf-wqy-microhei            Recommends: winetricks but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).  I did the command and it said something about /var/lib/dpkg/lock, so I go there and can't open the file. I am trying to install WINE 1.7 for Ubuntu 14.04 64-bit.


A word for "someone who started a new work/job/etc. but has a long way to go "?

I need a word for this definition:  "Someone who started a new work/job/etc but has a long way in front to achieve the goal."  Do you know of any word?


Implementing Quote of the day in Java programming

This is my server side code  public class Rfc865UdpServer {      static DatagramSocket socket;      public static void main(String[] argv) {         try{             socket = new DatagramSocket (17); //open port 17 RFC865 quote of the day         } catch (SocketException e){}          while (true)         {             try{                 byte[] buffer = new byte[1024];  //declare the buffer and the size of the buffer                 byte[] sendData = new byte[1024];                  DatagramPacket request = new DatagramPacket(buffer,buffer.length);                  socket.receive(request);                  String test = new String (request.getData());                  InetAddress IPAddress = request.getAddress(); //get address of the source of the sender                 int port = request.getPort(); // get the port of the sender                //  System.out.println ("RECEIVED : " + test);                //3.send udp reply to client                  String capSen = test.toUpperCase();                  sendData = capSen.getBytes();                  DatagramPacket reply = new DatagramPacket (sendData , sendData.length, IPAddress ,port); //creating packet containing the buffer for the quote, IP and port of the Destination.                 socket.send(reply); //send packet created earlier using RFC865 udp              } catch (IOException e) {}         }     }  }   I console got an error:  Exception in thread "main" java.lang.NullPointerException     at cnetwork.Rfc865UdpServer.main(Rfc865UdpServer.java:29)  Client side  public class Rfc865UdpClient {      static DatagramSocket socket;      public static void main(String[] argv){         // 1. Open UDP socket         try {             socket = new DatagramSocket ();           } catch (SocketException e){}          try {             //2. Send UDP request to server             byte[] buffer = new byte[1024];                           byte [] sendData = new byte [1024];             String msg = new String ("hello there " + InetAddress.getLocalHost().getHostAddress());             sendData = msg.getBytes();             InetAddress dest = InetAddress.getByName("abc");             DatagramPacket request = new DatagramPacket(sendData,sendData.length, dest ,17);              socket.send(request);              //3. Receive UDP reply from server             DatagramPacket reply = new DatagramPacket (buffer, buffer.length);              socket.receive(reply);              String QOTD = new String (reply.getData());             System.out.println("From Server : "+ QOTD);             socket.close();         } catch (IOException e){}     } }   Client has no error when I compile it


Why does nginx select a location block with a non-matching regex?

In my nginx config file I have this location block (modified for debugging purposes):  location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {     expires 1;     log_not_found off;     return 515 "Request URI is $request_uri. Caught you"; }   When I request this URI from the server: /img/signup/be0e1d34fabf2514d49db9baec09f858.png?w=198&h=198&s=9a7d22504c5ae176a936a0f18cccacba  sure enough, it matches and I get a 515 response with this body: Request URI is /img/signup/be0e1d34fabf2514d49db9baec09f858.png?w=198&h=198&s=9a7d22504c5ae176a936a0f18cccacba. Caught you  Why? The regex doesn't match, at least not intuitively (either it must end in a question mark followed by a series of digits, or in .png etc.), nor when I sense-checked it at .


Operation of Induction Motors and their Back EMF

I'm trying to reconcile the physical steps that go into the operation of an AC induction motor. Looking online, I either find broad and general explanations that I already know and understand, or very specific and math heavy explanations that get a bit overly detailed.  I understand synchronous motor operation and describe it in my head like this: "From standstill, voltage is applied to the rotor. This creates a current in the rotor which generates a magnetic field which starts to turn the rotor due to attraction to the magnets of the stator. At the start, the rotor has little movement relative to the stator's field, so little back-emf is created, allowing for maximum current to flow, and so the machine has max torque at the start. As it gets up to speed, the rotor's quick movement cuts through more of the stator's flux, and generates more intense back-emf, which fights the input voltage, limiting current into the rotor, and torque drops off until some balance of speed/torque is achieved with the load.  But when I try to create the same "story" of what happens in an induction motor, I must have some fundamental misunderstanding (probably about back-emf), because I run into this: "At standstill, an AC voltage is applied to the stator windings, quickly manifesting a rotating magnetic field. This induces a voltage in the rotor coils, creating a current that manifests its own magnetic field such that the induced voltage/field opposes what created it. Now the relative motion of the rotating stator field and rotor coil would be maximum at startup, creating maximum possible back-emf.... and that's where my thinking fails. If the back-emf is biggest at the start, it'll fight the input voltage the most at the start, which will result in the least current and least torque at the start... and the thing will never get up to speed."  Obviously that's wrong, but I don't see where. In a DC motor, it makes sense easily because input voltage, back-emf, and rotation, are all in the rotor. So when the rotor speed is low, it cuts less flux, and creates low back-emf. When the rotor speed is high, it cuts more flux, and creates higher back-emf. A nice feedback loop.  But it seems reversed for the induction case the way I'm thinking of it. At a low rotor speed, the rotor would cut through more flux, because the stator field is quickly rotating around it. This would create a higher back-emf in the rotor, fighting the input voltage, limiting the input current, reducing torque, and slowing the machine or keeping it from moving.   Then at a high rotor speed, the rotor would cut through less flux, because it's catching up to the rotational speed of the stator's field. This would generate less back-emf in the rotor, which would mean the input voltage isn't being fought as much, increasing current, increasing torque, speeding the device up.  So my thinking ends up with the opposite of a self stabilizing device. If it slowed down, it'd want to keep slowing to standstill, and if it sped up, it'd want to keep speeding up...  None of that is right, so I must be messing something up about how back-emf operates in an induction motor. And I think the inverse nature of how the rotor speeding up leads to amount of flux being cut to be lower is also tripping me up...  Thank you so much for any help with a layman's quest for understanding!


How to correctly handle UTF8 results from a MYSQL database with PHP?

For a few days now I've been looking for a solution to display UTF8 on my webpage.  The character currently causing trouble is į (unicode: \u012f  decimal: 303) however, there are over 10,000 records in my database and I cannot guarantee that all others are displaying correctly. So I'm looking for a solution that should cover all characters.  The į is displaying as a ? in the HTML.  My setup is a HTML page, which uses AJAX to send a request to a PHP file. The PHP then queries a MYSQL database to find a specific entry,  it then takes a lithuanian word from that entry and echoes it as a response to AJAX. Back in the Javascript, the response is set as the innerHTML of a HTML element. This current setup is not using JQuery.  Below is my progress on attempting to fix the issue.  First, I verified that all files I was working with are correctly encoded to UTF8, not UTF8BOM.  Then I opened the MYSQL database in phpMyAdmin to view the entries. Seeing characters replaced with ? in the entries, I done some research and found the database had the wrong collation. After changing the collation to utf8_general_ci for the database/table nothing changed, so I looked into it further and found that changing it for individual columns of a table was another solution. This worked and my database is now displaying the characters correctly.  Next the character š (unicode: \u0161   decimal: 353) would not display in my webpage,  I fixed this by using the following code in PHP which I found on stackoverflow.  function encode_string($string){      $encoded = "";      for ($n=0;$n<strlen($string);$n++){          $check = htmlentities($string[$n],ENT_QUOTES);         $string[$n] == $check ? $encoded .= "&#".ord($string[$n]).";" : $encoded .= $check;      }      return $encoded;  }    I can't say I completely understand this code but it caused the character š to display correctly when it got to my HTML. However this did not work for the character į.  I have also tried $conn->set_charset('utf8'); to set the connection to use utf8 however this resulted in į being displayed as Ä¯ instead, same result for $conn->query("SET NAMES UTF8;");  I have found that hardcoding the į into the Javascript or PHP, allow it to be sent back and displayed correctly, for example echo "į"; works. So I believe the issue may be related to the database or in the PHP before the echo. However I don't have the knowledge to identify the problem.  Here is my php code below:  <?php header('Content-Type: text/html charset=utf-8'); //Connection to database is made. Referred to as $conn  $sql = "SELECT * FROM Words"; $result = $conn->query($sql);  if ($result->num_rows > 0) {      //Loop through the results to find a word with the status of 1     while($row = $result->fetch_assoc()) {          $status = $row["status"];          if($status == 1){             //respond to AJAX with the word              $ltword = trim($row["lt"]);               echo utf8_encode(encode_string($ltword));             //Has also been tested as              //echo encode_string($ltword);             //with no noticeable difference.               break;         }     }  }   function encode_string($string){      $encoded = "";      for ($n=0;$n<strlen($string);$n++){          $check = htmlentities($string[$n],ENT_QUOTES);         $string[$n] == $check ? $encoded .= "&#".ord($string[$n]).";" : $encoded .= $check;      }      return $encoded;  }  ?>   At the core my question is, given my current setup,  how do I correctly get an encoded UTF8 character from my database to display on my webpage?  EDIT: The mb_check_encoding() function of php, verifies that the data received from the database is valid utf8.  php.ini is using utf8 as it's default charset.  Using $conn->character_set_name(); returns the result latin1. Using $conn->set_charset("utf8"); causes it return utf8, however į is then displayed as Ä¯ which is still incorrect.


Keep specific command away from shell history

I have a command that actually clears the screen instead of simply scrolling, like the default clear, aliased to c in my .zshrc:  alias c='clear && printf "\e[3J";'   My question is: how can I keep this command away from my zsh command history, so that when I scroll up with the up arrow key I don't see it?


Determine the number of nonnegative integer solutions of the equation $x+y+z+t=98$.  Dear ones, please indicate a method or suggestion to solve. Thanks.


When to use ref and when it is not necessary in C#

I have a object that is my in memory state of the program and also have some other worker functions that I pass the object to to modify the state. I have been passing it by ref to the worker functions. However I came across the following function.  byte[] received_s = new byte[2048]; IPEndPoint tmpIpEndPoint = new IPEndPoint(IPAddress.Any, UdpPort_msg); EndPoint remoteEP = (tmpIpEndPoint);  int sz = soUdp_msg.ReceiveFrom(received_s, ref remoteEP);    It confuses me because both received_s and remoteEP are returning stuff from the function. Why does remoteEP need a ref and received_s does not?  I am also a c programmer so I am having a problem getting pointers out of my head.  Edit: It looks like that objects in C# are pointers to the object under the hood. So when you pass an object to a function you can then modify the object contents through the pointer and the only thing passed to the function is the pointer to the object so the object itself is not being copied.  You use ref or out if you want to be able to switch out or create a new object in the function which is like a double pointer.


how do I add a shadow on the floor of a tracking scene?

Im having trouble adding a shadow to my scene. I have one scene of the main object (pic 1) and one scene with the ground (pic 2) But when I render them together, the result is just the main object with no floor or shadow. When rendering the floor is invisible. Im using Blender render and I would prefer it to stay that way. If you need more information you can comment below. Any help would be appreciated and thanks in advance!


Strange dependencies when install Java 6 from Oracle to Debian Lenny

Trying to install Oracle Java 6 SDK to Debian Lenny. I have downloaded rpm file. After executing command  rpm -ivh jdk-6u45-linux-i586.rpm sun-javadb-core-10.6.2-1.1.i386.rpm sun-javadb-demo-10.6.2-1.1.i386.rpm sun-javadb-docs-10.6.2-1.1.i386.rpm sun-javadb-javadoc-10.6.2-1.1.i386.rpm sun-javadb-client-10.6.2-1.1.i386.rpm   got output:  /bin/basename is needed by jdk-1.6.0_45-fcs.i586 /bin/cat is needed by jdk-1.6.0_45-fcs.i586 /bin/cp is needed by jdk-1.6.0_45-fcs.i586 /bin/gawk is needed by jdk-1.6.0_45-fcs.i586 /bin/grep is needed by jdk-1.6.0_45-fcs.i586 /bin/ln is needed by jdk-1.6.0_45-fcs.i586 /bin/ls is needed by jdk-1.6.0_45-fcs.i586 /bin/mkdir is needed by jdk-1.6.0_45-fcs.i586 /bin/mv is needed by jdk-1.6.0_45-fcs.i586 /bin/pwd is needed by jdk-1.6.0_45-fcs.i586 /bin/rm is needed by jdk-1.6.0_45-fcs.i586 /bin/sed is needed by jdk-1.6.0_45-fcs.i586 /bin/sort is needed by jdk-1.6.0_45-fcs.i586 /bin/touch is needed by jdk-1.6.0_45-fcs.i586 /usr/bin/cut is needed by jdk-1.6.0_45-fcs.i586 /usr/bin/dirname is needed by jdk-1.6.0_45-fcs.i586 /usr/bin/expr is needed by jdk-1.6.0_45-fcs.i586 /usr/bin/find is needed by jdk-1.6.0_45-fcs.i586 /usr/bin/tail is needed by jdk-1.6.0_45-fcs.i586 /usr/bin/tr is needed by jdk-1.6.0_45-fcs.i586 /usr/bin/wc is needed by jdk-1.6.0_45-fcs.i586 /bin/sh is needed by jdk-1.6.0_45-fcs.i586 sun-javadb-common is needed by sun-javadb-core-10.6.2-1.1.i386 /bin/sh is needed by sun-javadb-core-10.6.2-1.1.i386 sun-javadb-common is needed by sun-javadb-demo-10.6.2-1.1.i386 sun-javadb-common is needed by sun-javadb-docs-10.6.2-1.1.i386 sun-javadb-common is needed by sun-javadb-javadoc-10.6.2-1.1.i386 sun-javadb-common is needed by sun-javadb-client-10.6.2-1.1.i386   Why I got such strange dependencies? For example   /bin/ls is needed by jdk-1.6.0_45-fcs.i586   I definitely have ls command on my system why Java install complains about it?


is party bridge the same as rubber bridge?

I am in a group that says we play party bridge and the rules for honors are different than for rubber bridge. What exactly are the differences between party bridge and rubber bridge, and why are they different?  For example, are the honors scored the same in both party bridge and rubber bridge?


I am trying to append a new row in a table with a variable   I used this line of code with no luck    $('.view-payments table').append('
Amount	' grandTotal '
');   What is the problem?


Writing pseudocode for parallel programming

"How do you write pseudo-code for parallel programming? Especially, how do you differentiate local and shared variables? How do you represent operations like scatter, gather, reduce, broadcast, and point-to-point communications? Is there some standards about that?"  Please, note the original question was asked  but it still does NOT have a good acceptable answer.  Re-elaborating other questions, summarizing and keeping the things easy: is there a way of saying in pseudocode "DO ALL THESE THINGS IN PARALLEL"?  I am using the package algorithm2e with TeXStudio. How to typeset the parallel code using them?


How to remove Ubuntu EFI system partition?

I installed Ubuntu 19.04 alongside Windows 10. While installing I created swap area, EFI system Partition, home partition and root partition.  Now, I want to remove the Ubuntu so in windows I deleted all the partition relating to Ubuntu.  However the EFI system partition can't be deleted. So I searched it over internet and got a process which guides through the diskpart in terminal.      diskpart  list disk(EFI system partition was in volume 5) sel vol 5 assign letter=Z:   after that I went to open a new powershell window where I cd over to the Z drive I created. Inside that was two folder Ubuntu and Boot, which I was little confused about. I rmdir both directory.  Going back to the diskpart, I tried to format the volume Z or say volume 5 in which EFI system partition is but was unable to delete that partition.   This is the image and 477 mb partition is the partition I want to delete. On right click it only shows help option.     How do i delete this partition?


What does it mean to be "sh compatible"?

I've seen the phrase "sh compatible" used usually in reference to shells. I'm not sure if it also applies to the programs that might be run from within shells.  What does it mean for a shell or other program to be "sh compatible"? What would it mean to be "sh incompatible"?  Edit: This question asking the difference between bash and sh is very relevant:   I'd still like a direct answer to what it means to be "sh compatible". A reasonable expectation might be that "sh compatible" means "implements the Shell Command Language" but then why are there so many "sh compatible" shells and why are they different?


I know how setgid works, but I don't know why it is designed, is there any example to illustrate what problems it solves?


Removing the Ubuntu 16.04 Operating System

Can the Ubuntu 16.04 Operating System be removed / emptied from my computer? Help me to solve this, I want to restore my computer like a new situation, which is without an operating system.


Footnote to an item in a description environment

It seems like it's not possible to put footnote inside a description list item.  For example in the following code first footnote appears at the bottom of the page, but the second - doesn't:  \documentclass[a4paper,12pt]{article}  \begin{document}     Text text text.\footnote{This footnote is working}     \begin{description}         \item[Label\footnote{This footnote is not working}] Some description     \end{description} \end{document}   Why it's not working this way? And is there any way to put footnote to a list item?


Falling space debris defence systems in the Star wars universe

I was recently watching Episode 3 and a few clone wars episodes, and I found myself thinking during the opening battle between the Republic and General Grievous' forces above Coruscant, on a planet so densely populated where potentially thousands of inhabitants can be killed from a drifting capital class ship with a decaying orbit during space battles what defenses are in place?  Is there any instances of some form of emergency services that tractor beam chunks of debris to safe landing places or repulsor towers that can slow or suspend it until it can be taken apart safely? Even disintegration lasers or emergency force field generators like the types deployed on Hoth as they must have the energy output capable of sustaining it. This IS the galactic capital so must have some advanced tech at its deposal. Even now in our own development humans have certain preventative measures for all types of threats and ways of tracking them, plus responses or fall back plans.


How can I generate different random numbers using a seed with a loop?

I'm making a simple gradebook that's supposed to generate random numbers for each assignment for each student. It generates random numbers, but the numbers are the same each loop. Here's the code I have so far:  import java.util.Random; import java.util.Scanner;  public class Testing { public static void main(String args[]) {     Scanner sc = new Scanner(System.in);     String choice = "y";     while (choice == "y")   {           System.out.println("Please enter a number for the random number generator seed:");         //User input for seed         int seed = sc.nextInt();          //Initializing Seed         Random randomSeed = new Random(seed);          //Prompting for number of students         System.out.println("Please enter the no of students for whom you have grade information: ");          //User input for number of students         int numberOfStudents = sc.nextInt();          String homework = "HW";          System.out.printf("%16s", homework);         System.out.println("\n");          //Finding random value for Homework.         int randomHomework = randomSeed.nextInt(((600-300) + 1) + 300);           //Creates an array that has 7 rows for points         //Will eventually add more values into array         int points [][] = new int[6][3];           //for loop that starts at 1 and prints number of students user entered         for (int i = 0; i < numberOfStudents; i++) {             System.out.print("Student #" + (i + 1) + "    ");              points[0][2] += randomHomework;             System.out.print(randomHomework + "    ");              System.out.println("\n");             }//End of for loop          choice = sc.nextLine().toUpperCase();         }//End of while loop     } }   I get 540 points for each student, but I should be getting a random value between 300 and 600 for each student each time it loops.   Thanks for anything!


Mapping shapefile attributes to raw data

I have raw address data stored in a sql server database (2012) which comprises address, city/suburb, state and generally country (Australia).  I would like to take this address data and following geocoding to long/lat coordinates, match these points to a respective shapefile containing administrative boundary data/polygons.  My aim is to add columns to my address data from attributes from the shapefile e.g. LGA_NAME for the purpose of mapping within reporting tools like report builder 3 or Tableau.  I have a copy of QGIS I am experimenting with but haven't found a way to do what I want as yet.    I suspect this would be a fairly straightforward task and the point in polygon concept suggests it should be possible.    I have looked for a suitable tutorial for this but am yet to find anything.    Can anyone help?


This is probably a noob question, but I forgot how to edit my profile.   Can anyone help me? There is no visible button for me.


How do I make sense between difference in Eigenvalue variance and extracted some of squares variance?

I'm doing an EFA on a scale that was designed to quantify LSD's effects. However we have a applied it in patients receiving Ketamine. We are doing the EFA because we wan't to see which items of the scale are relevant when applied for this purpose.  What I'm trying to understand is that when I run the EFA in SPSS, the first factor (Which contains only 3 items) has an Eigenvalue of 6.898, accounting for 29.9% variance. The next factor which contains most of the items has an Eigenvalue of 1.902, explaining 8.269% of variance.  BUT in the Extraction Sums of Squared Loadings, the first factor explains on 9.437% of variance and the second 24.015% of variance. What is the difference between these two measures? I've seen cases where they are slightly different, but here the second factor accounts for much more variance in the sums of squared analysis. Does this mean that this factor is indeed the one which accounts for more variance, despite initially having a much lower Eigenvalue?


I'm lost in a Exception in thread "main" java.lang.NullPointerException

I am having trouble finding why I am getting a null pointer exception. I have gone through the threads but just can't seem to locate exactly what my problem is and how to fix it.   public class Reading_CSV { private final List<Vertex> verticies; private final List<Edge> edges; Reading_CSV() {     this.edges=null;     this.verticies=null; }  public Reading_CSV(List<Vertex> vertecies, List<Edge> edges, String csvfile) throws FileNotFoundException, IOException {     this.edges=edges;     this.verticies=vertecies;     CsvReader data = new CsvReader(csvfile);     if(data.readHeaders())     {         for(int i=0;i<data.getColumnCount();i++)         {             data.get(i);             Vertex v=new Vertex(Integer.toString(i),data.get(i));             this.verticies.add(i,v);         }     }     int j=0;     while(data.readRecord())     {         Vertex Source=null;         String sr=data.get(0);         for(int i=0;i<this.verticies.size();i++)         {             if(sr == null ? vertecies.get(i).getName() == null : sr.equals(vertecies.get(i).getName()))             {                 Source=vertecies.get(i);                 break;             }         }         for(int i=0;i<data.getColumnCount();i++)         {             String d=data.get(i);             int value=Integer.parseInt(d);             if(value!=0)             {                 String Dest=data.getHeader(i);                 Vertex Destination=null;                 for(int k=0;k<verticies.size();k++)                     {                     if(Dest==vertecies.get(i).getName())                     {                         Destination=vertecies.get(i);                         break;                     }                     }                 this.edges.add(new Edge(Integer.toString(j), Source, Destination, value));                 j++;             }         }     } }  public List<Vertex> getVerticies() {     return verticies; }  public List<Edge> getEdges() {     return edges; }   }  public class Algo {  /**  * @param args the command line arguments  */ public static void main(String[] args) throws IOException {     /*     Maintaining list of edges and vertices     */      List<Vertex> vertecies = null;      List<Edge> edges = null;       String csvfile="myfile.csv";      Reading_CSV csv=new Reading_CSV(vertecies, edges,csvfile);      vertecies=csv.getVerticies();      edges=csv.getEdges();      Graph myGraph=new Graph(vertecies, edges);      Scanner scan=new Scanner(System.in);      System.out.println("Enter the Source");      String src,dest;      src=scan.next();      System.out.println("Enter the Destination");      dest=scan.next();       DijkstraAlgorithm algorithm=new DijkstraAlgorithm(myGraph);      Vertex Source=null;         for(int i=0;i<vertecies.size();i++)         {             if(src==vertecies.get(i).getName())             {                 Source=vertecies.get(i);                 break;             }         }      algorithm.execute(Source);      Vertex Destination=null;         for(int i=0;i<vertecies.size();i++)         {             if(dest==vertecies.get(i).getName())             {                 Destination=vertecies.get(i);                 break;             }         }          System.out.println(algorithm.getPath(Destination));  }   }  Algo is my main class. I am getting exception thrown and I am sure this is an easy solution but I have been spending a while trying to figure this out. The exception thrown is:  Exception in thread "main" java.lang.NullPointerException at ReadingCSV.Reading_CSV.<init>(Reading_CSV.java:45) at Algo.main(Algo.java:34)   Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds)


Prove that if $a_1, a_2, \cdots , a_n$ are all distinct, then $f(x)=1+\sum_{i=1}^{n}(x-a_i)^2$ is irreducible

Prove that if $a_1, a_2, \cdots , a_n$ are all distinct, then $$f(x)=1+\prod_{i=1}^{n}(x-a_i)^2$$ can never be written as the product of two polynomials with integer coefficients.  Write ${f(x)=g(x)h(x)}$. Then, $f(a_i)=1=g(a_i)h(a_i)$.  Now, if both $g(a_i)$ and $h(a_i)$ equals $+1$ or $-1$ for all $i\in\{1,2,\cdots, n\}$ then, we can say that $g(x)-1$ or $g(x)+1$ will have $n$ roots. Now since there can be at most of $n$ roots for $g(x)$ assuming that $\text {deg}(g(x)) \leq \text {deg}(h(x))$, we get that there exists all $n$ roots. Then continuing that way we get a contradiction.   But what if for some $i \in \{1,2,\cdots , n\}$, we have $g(a_i)=1$ and for the rest $g(a_i)=-1$? It may be possible because $g(a_i) h(a_i)=1=\{(1,1),(-1,-1)\}$  EDIT (Please check) :  A link has been provided below but $g(a_i)h(a_i)=1$ also implies that $g(a_i)=h(a_i)=-1$ for $i=\{1,2,\cdots , k\} \ni k < n\}$ and $g(a_i)=h(a_i)=1$ for $i=\{k+1,k+2,\cdots, n\}$. And this case isn't justified in that thread.


Name 'not defined' even though it is, in a separate function

I have a part of a bigger program here:  from random import randint  def computerChooses():     import random     choices = ["rock", "paper", "scissors"]     computerChoice = choices[randint(0,2)]     def whoWins():     if computerChoice == "rock":                 print("DO THIS")     elif computerChoice == "paper":                 print("DO THIS")     elif computerChoice == "scissors":                 print("DO THIS")  computerChooses() whoWins()   I always end up with:  NameError: name 'computerChoice' is not defined   (even though I believe it is!)  This, the error message states, is for line 20, and line 12.  What did  I do wrong and where, specifically?  Thanks, Khy


Using same keypair for Diffie-Hellman and signing

Are there any security risks using a single key-pair for both key-exchange and signing?  I'm mainly interested in using Curve25519 for key-exchange and Ed25519 for signing. But similar combinations, such as EC-DH and EC-Schnorr or even EC-DSA with the same key pair would be interesting too.   Curve25519 hashes the output of an x-coordinate only Diffie-Hellman key exchange Ed25519 is a slight variant of EC-Schnorr signatures.   I saw some recommendations to avoid using a single key for multiple purposes, but I couldn't find anything concrete.


Using STUFF in order to get multiple elements into one block in SQL

I have three tables.  1st Table is called Customers with this dummy info in it:    2nd table is called Customer_Product with this dummy info in it:    3rd table is called Products with this dummy info in it:    And the diagram looks like this:    I currently have this code that I wrote:   SELECT      A.Customer_Name [Customer Name],      (SELECT CASE         WHEN A.Customer_ID = A.Customer_Parent_ID             THEN 'Is the Parent'         ELSE(         SELECT F.Customer_Name          FROM dbo.Customers F          Where F.Customer_ID = A.Customer_Parent_ID)      END)  [Customer Parent's Name],     C.Product_Name [Product They Own] FROM dbo.Customers A  JOIN Customer_Product B ON A.Customer_ID = B.Customer_ID JOIN Products C ON C.Product_ID = B.Product_ID   That gives this output:    My question is how can I write a query that instead of what its currently giving me, it would give me an output that looks like this:    Thank you for any and all help! I'm new to SQL so an answer here doesn't really stand out to me, that current code is the closest I can seem to get to what I want. I realize I'll need to use STUFF, but I don't understand how. I've been taking a look at this post () and trying to use it to work for me, but with little luck.


I do a lot of work with many different bootable images all on different flash drives. However, it gets annoying to search for a specific drive, plug it in, and use it. Is there a way I can consolidate all of  my tools on to one large USB drive? I should be able to select what tool.  Because some of you were bound to ask. My tools are:   Kali Linux Hiren's Boot CD Ubuntu Installer (with persistent partiton) Kon-Boot Other various little tools   I would like all of the above on one flash drive with a relatively simple way to swap between them. Is this even possible? If possible, I would like to have EFI support (preferably with a digital signature, but this is not required)


How to reduce the amount of noise in the rendered image?

The following image was rendered using 2000 samples.  The render takes about 3 mins and the image looks pretty noisy still, especially the wall of the building. I'm gonna have to render a really long animation so I would prefer to keep the samples less than 2000 so it doesn't take forever to render the whole animation.   I searched online for a solution and tried everything that was suggested in this post: .   It helped some but the noise is still present in the image. I was wondering if there are any other ways to reduce the noise without increasing the sample number (through lighting or maybe using compositor)? Any suggestions are appreciated. Thanks in advance.


What is the fastest way to level up my speech skill?

How can I level up my speech skill? Does selling items and persuading people increase my speech skill? Does it increase my speech skill when I wear fortify speechcraft and haggling clothes and drink fortify haggling potions?


setbackgroundtemplate on title page within custom theme file

I am working on a presentation theme for use with conference presentations. Most of our powerpoint themes use some type of background image on the first (title) slide, which I am trying to reproduce.  I can accomplish what I want by using  \usetheme{Mytheme} \begin{document} { \usebackgroundtemplate{\includegraphics[width=\paperwidth]{MyBackground.jpg}} \frame{\titlepage} } % Etc etc \end{document}   This appears as I expect, with the image behind the presentation title, and only on the title slide.  What I want to do is move the use of the backgroundtemplate command in to the beamerthemeMytheme.sty file so that someone else using the theme down the road doesn't need to figure that particular command out. However, no amount of tweaking of setbeamertemplate{titlepage} { ... } has gotten this command to work.  I've seen  using pgfimage to accomplish this effect, but my attempts have not come out nearly as cleanly as usebackgroundtemplate. For example, either:  \setbeamertemplate{title page}{     \usebackgroundtemplate{\includegraphics[width=\paperwidth]{MyBackground.jpg}} }   nor  {     \usebackgroundtemplate{\includegraphics[width=\paperwidth]{MyBackground.jpg}}     \setbeamertemplate{title page}{     % ...     } }   have worked.  Is there a way to use usebackgroundtemplate (Or a similar command) from within a beamer style file?


I have seen other similar questions but they don't seem to be what I want, please correct me if I'm wrong.  For simplicity: delete the default cube, NumPad7, add cylinder, rotate X 90, then add torus with ext/int 1/0.75 and raise it above the cylinder. It should look like this:.  What I want is to deform the torus against the cylinder, but make it as if it's a projection. This means that, when looked from above, it will look like a normal, undeformed torus (volume changes), but when viewed with NumPad1, it will look like a round-end tube following the curvature of the cylinder, while still having the same round cross-section. To make it worse, my object needs to be deformed by a more complex surface, such as sin(x).  If I'd use soft body, it will look shrinked when looking from above, i.e. it will preserve the volume. If I use shrinkwrap, it either does a projection with its circumference intact, but all flat, or it will project it (similar to what I want), but only the bottom side vertices, like a curtain.  Mesh modifier gets me nowhere since I have to manually tweak the surrounding mesh, and curve modifier also preserves the length/volume, while also squishing the section of the torus at the bending points.  My question(s): is there a way to project (mold) the torus onto the cylinder while preserving it's cross-section? Can this be extended for more complex meshes to be projected or to be projected on?    This is, roughly, what the side view (along Y axis in the 1st pic) would look like after the deforming of the torus:    The unselected shape above is the torus (as it is in the first picture), and the selected shape is what it would look like after the deform, or molding, whatever you want to call it.  And here is what it would look like when seen from above (top view, along Z axis)): i.stack.imgur.com/HVOCo.png (can't add more than 2 pics)  The view would be the same before and after the torus is deformed.


Using enumerate loop to update a list of dicts in python not working as expected

I have a list of dictionaries in python. I want to update one key:value pair for all the dicts with unique values but instead all of them are getting the same value.  Here's my code:  num_cntxts=4 pkt_eop   =[{'type' : 'eop', 'number':1}] pkt_eop_pattern = pkt_eop*num_cntxts  #I want to add a 'cntxt' key to each of the 4 dicts #which should have the value as the list position  for i,pkt_eop_inst in enumerate(pkt_eop_pattern):    print i,pkt_eop_inst    pkt_eop_inst['cntxt']=i  >0 {'cntxt': 0, 'type': 'eop', 'number': 1} 1 {'cntxt': 2, 'type': 'eop', 'number': 1} 2 {'cntxt': 4, 'type': 'eop', 'number': 1} 3 {'cntxt': 6, 'type': 'eop', 'number': 1}  The print statement shows the individual dict elements but the result is:   >pkt_eop_pattern '[{'cntxt': 6, 'type': 'eop', 'number': 1}, {'cntxt': 6, 'type': 'eop', 'number': 1}, {'cntxt': 6, 'type': 'eop', 'number': 1}, {'cntxt': 6, 'type': 'eop', 'number': 1}]   What I wanted was the pkt_eop_pattern to match the print output:  >pkt_eop_pattern '[{'cntxt': 0, 'type': 'eop', 'number': 1}, {'cntxt': 2, 'type': 'eop', 'number': 1}, {'cntxt': 4, 'type': 'eop', 'number': 1}, {'cntxt': 6, 'type': 'eop', 'number': 1}]   When I iterate over the list, I expected to get a pointer to each dict. However, that is not the case since all elements are taking the value of the last iteration.


Get PID of any command in backgrounded piped sequence of commands

If, in bash, I execute:  cmd1 | cmd2 | ... | cmdi | ... | cmdn &   where the cmd{1..n} may not be distinct, how do I get the PID of cmdi? Alternatively, how can I signal the cmdi process? (For example, send it SIGUSR1?) pkill/pgrep, pidof etc. don't look like good answers, since other instances of cmdi maybe running, including as part of the same pipeline. jobs -p gives the PID of cmd1, for me.   i can be anything in {1..n}.


How can I prevent a pause at the end of animation loop to have fluid motion.

At the end of my animation, the animation pauses a bit then loops again, how can I stop the slow pause, and let the loop work fluently?


Null Pointer exception while writing into the file

hey when i create a file the logs show that file is created but it not existed in system, and while writing into that file it says null pointer exception is there anyone can help me please  try {   File root = android.os.Environment.getExternalStorageDirectory();   File dir = new File (root.getAbsolutePath()+ "/Sniffiing");   dir.mkdirs();   File file1 = new File(dir,"dump1.txt");   file1.createNewFile();   System.out.println(file1);  System.out.println("Hello Buddy what are upto.....##########################");   OutputStreamWriter os = new OutputStreamWriter(                                         new FileOutputStream(file1));   bw = new BufferedWriter(os);   Process process = Runtime.getRuntime().exec(                                         "logcat -v threadtime -s ServiceMode");    int length = process.toString().length();     System.out.println("Length" + length);     BufferedReader reader = new BufferedReader(                                         new InputStreamReader(process.getInputStream()));     StringBuffer output1 = new StringBuffer();     while ((line = reader.readLine()) != null) {      bw.write(line);      bw.newLine();    }  } catch (IOException e) {  }    here is Logcat  D/action: 0 D/ACTION:: BOTH D/Log3GState:: Accessing  file D/Create file: /data/user/0/com.services.snifspoof.snifspoof/C_packetCapture D/Log3GState:: Write executable  file D/EGL_emulation: eglMakeCurrent: 0x9ef850c0: ver 2 0 (tinfo 0x9ef831f0) D/EGL_emulation: eglMakeCurrent: 0x9ef850c0: ver 2 0 (tinfo 0x9ef831f0) D/CLOSING: BOTH I/System.out: *********############# I/System.out: *********############# File Created :- /storage/emulated/0/Sniffing/dump1.txt I/System.out: Length34            --------- beginning of crash E/AndroidRuntime: FATAL EXCEPTION: Thread-2  Process: com.services.snifspoof.snifspoof, PID: 2389  java.lang.NullPointerException: Attempt to invoke a virtual method on a null object reference  at com.services.snifspoof.snifspoof.MainActivity$3$1.run(MainActivity.java:167)  at java.lang.Thread.run(Thread.java:761)


I'm using a Canon EOS Rebel with 1.6 crop factor. In terms of focal length- Is an EF 16-35 mm full frame lens on a full frame camera equivalent to an EF-S 10-22mm lens taking into account my crop factor? The math works at least but is the effective focal length essentially equal?


17.10 minimum print screen - no more popup window just screenshot in Pictures

Since I upgrade to 17.10 when I do PrtScr or Ctl+Sht+PrtScr it just get the screen shot in the Pictures directory. Before I had a popup window with different options (naming, pasting into clipbboard, etc).  Is there a way to have this popup back ?


I hope you can help me. I am new ubuntu user and I want to switch to Ubuntu, and I have made yesterday an USB for installing Ubuntu on my computer. But there is a problem: when I choose my USB in the boot system nothing is happening. I see just a long time a black screen.


If $0\rightarrow A\rightarrow B\rightarrow C\rightarrow 0$ is exact and $B\simeq A\oplus C$ as a $R$-module, does this sequence split?

Suppose $0\rightarrow A\rightarrow B\rightarrow C\rightarrow 0$ is a short exact sequence that $B\simeq A\oplus C$ as a $R$-module. Does this short exact sequence split?   I think the answer is no, but I must have a counterexample. I could not find any. Can you help me?


Solving trigonometric derivative problems

I have a function $F(θ) = \sin^{−1} \sqrt{\sin(11θ)}$  I derived the following answer using basic trigonometric and quotient rules.  $\dfrac{11\csc \left(\left(11\theta \right)^{\left(\frac{1}{2}\right)}\right)\cos \left(\left(11\theta \right)\right)}{2\sqrt{1-\sin \left(11\theta \right)}}$  My answer however is wrong. I am having a very bad time with getting the solution for it.  Can anyone outline how to go about getting the correct solution to a problem such as this?


Is it possible to read CSS class attribute value before the class is added to an HTML Element using javascript?

Is it possible to read a CSS class attribute value before the class is added to an HTML element using javascript?   .myclass {     color: #00aa00;   }   For example, how can I read the "color" attribute value of "myclass" before the "myclass" added to an HTML element?


Formatting a Windows 8 drive to install Windows 7

I have problems with my Windows 8 due to compatibility issues with some of my applications. I need remove this Windows 8 and install Windows 7.  How do I do this?


How do I pluralize Italian foods, like pasta noodles (spaghetti, macaroni)?

Possible Duplicate:             Is it proper to say spaghettis for more than one spaghetti noodle?  What about macaronis as a plural for more than one macaroni noodle?


I'm just starting to learn Blender so I don't know whether I'm being stupid here, but it seems to me that the Solidify modifier is counting the wall thickness twice. A wall thickness of .5m in a 1m object means no hole surely? (Blender 2.9 on a MacBook Catalina)


Proper method to measure the magnification of a reversed lens

I have a 50mm prime lens and a 18-55mm standard lens at my disposal. How do I measure the magnification of a reversed lens when used with a reverse mount. What are the factors that come into play to calculate the magnification?


Why is $0^0$ also known as indeterminate?

I've seen on Maths Is Fun that $0^0$ is also know as indeterminate.  Seriously, when I wanted to see the value for $0^0$, it just told me it's indeterminate, but when I entered this into the exponent calculator, it was misspelled as "indeterminant".  Let's cut to the chase now.  I've seen this:$$5^0=1$$$$4^0=1$$$$3^0=1$$$$2^0=1$$$$1^0=1$$$$0^0=1$$and this:$$0^5=0$$$$0^4=0$$$$0^3=0$$$$0^2=0$$$$0^1=0$$$$0^0=0$$Right here, it seems like $0^0$ can be equal to either $0$ or $1$ as proven here.  This must be why $0^0$ is indeterminate.  Do you agree with me?  I can't wait to hear your "great answers" (these answers have to go with all of your questions (great answers).  What I mean is that you have to have great answers for all of your questions)!


TikZ/PGF 3.0 datavisualization vs pgfplots

To follow-up on a previous question , the current release of TikZ 3.0 has a flexible datavisualization engine that creates the same kind of plots as the more mature plotting package pgfplots.  What is the current recommendation for producing complete plots in LaTeX?


How does a uniform prior lead to the same estimates from maximum likelihood and mode of posterior?

I am studying different point estimate methods and read that when using MAP vs ML estimates, when we use a "uniform prior", the estimates are identical. Can somebody explain what a "uniform" prior is and give some (simple) examples of when the MAP and ML estimators would be the same?


Why are bonus tracks so common in Japanese versions?

Just as the title says: Why are bonus tracks so common in japanese versions of a release?


64 bytes from 8.8.8.8: icmp_seq=1 ttl=52 time=1.04 ms   Above I have a ping for my IP address how can I use the cut command or any other command to display only the time in ms like this  time=1.04 ms


How to solve 'Connection refused' errors in SSH connection?

I have an Ubuntu Server 10.10 32-bit in my home. I'm making SSH connections to it from my PC via Putty.  The problem is, sometimes I'm able to login seamlessly. However, sometimes it gives me an error like this: Network error: Connection refused.  Then, I dont't change anything, try to login a few times more, wait a while and try again. Sometimes I can log in, sometimes I cannot. It seems pretty random to me.  What can I do to solve this?  Edit:  And Sometimes, Putty gives Network error: Software caused connection abort error after displaying login as: text.  Here is the ping -t output:  Pinging 192.168.2.254 with 32 bytes of data: Reply from 192.168.2.254: bytes=32 time=6ms TTL=64 Reply from 192.168.2.254: bytes=32 time=65ms TTL=6 Reply from 192.168.2.254: bytes=32 time=88ms TTL=6 Reply from 192.168.2.254: bytes=32 time=1ms TTL=64 Reply from 192.168.2.254: bytes=32 time=3ms TTL=64 Reply from 192.168.2.254: bytes=32 time=1ms TTL=64 Reply from 192.168.2.254: bytes=32 time=1ms TTL=64 Reply from 192.168.2.254: bytes=32 time=1ms TTL=64 Reply from 192.168.2.254: bytes=32 time=1ms TTL=64     I turned off firewall of router, and everything seems to work now. Except for that, I still can't enter my web server by typing external IP from my PC.


Float point numbers are not equal, despite being the same?

The program below outputs This No. is not same. Why does it do this when both numbers are the same?  void main() {     float f = 2.7;      if(f == 2.7) {         printf("This No. is same");     } else {         printf("This No. is not same");     } }


Number of significant figures to put in a table?

Is there a well founded rule for the number of significant figures to publish?   Here are some specific examples / questions:   Is there any way to relate the number of significant figures to the coefficient of variation? For example, if the estimate is 12.3 and the CV is 50%, does that mean that the information represented by '.3' approaches zero?   If a confidence interval has a range of orders of magnitude, should they still have the same number of significant figures, e.g.:  12.3 (1.2, 123.4) vs 12 (1.2, 120)  Should the number of significant figures in an error estimate be the same or less than the number of significant figures in a mean?


Which algorithm does the JavaScript Array#sort() function use?  I understand that it can take all manner of arguments and functions to perform different kinds of sorts, I'm simply interested in which algorithm the vanilla sort uses.


Php script to upload photos for single user and protect them

I need to build a php script to upload images in a folder, store the name of the image on the database (Mysql in my case), protect the folder from direct access (probably using .htaccess) and get the images only if the user insert them in his post.   But how to do that? I'm not an expert in this type of thing and i don't know how to do this.  How to protect images from direct access? This is my primary problem.  Please, someone know were can I find a good guide for this? Or can someone teach me how can I do that?


Simplify geometry of multiple features without losing shape

I am simplifying administrative boundaries using a high simplify tolerance (which is my intention so as to get a minimalist appearance).  However, after simplification, the borders of the regions no longer fit together.  What would be the most effective way to solve this problem?


I've seen many posts about call by value and reference, but can barely find solutions for reference data types such as int[ ], or char[ ]. For example:  char b[] = new char[2]; b[0] = 'h'; b[1] = 'i'; char c[] = new char[2];  c = b;     //   copy by reference? copy(c,b); //   copy by value?  b[0] = 'b'; b[1] = 'y';  System.out.print(b[0]); System.out.println(b[1]);  System.out.print(c[0]); System.out.println(c[1]);       public static void copy(char[] dst, char[] src) { dst[0] = src[0]; dst[1] = src[1]; }   c = b; changes value because c gets b's address?  copy(c,b); can't change value because it is copy by value? But I thought char[ ] is one of reference data types which can change the value. For example int[ ] is reference data type so it can change the value like below:  int[] d = new int[1]; d[0] = 1;         function(d); System.out.println(d[0]);   public static void function(int[] a) {     a[0] = 4; }     Does anyone know about this?


Dunn's test p-values in R are exactly half those in SPSS and GraphPad for the same data

Firstly, this is my first post to Cross Validated, so apologies in advance if I have infringed any conventions.  I am writing up a PhD thesis on aspects of biomedical research, and use R for my statistics. However, I always check some of the data against another package in case I have made a coding error.  I have been running a Kruskall-Wallis test with three groups (sample sizes of 5, 8 and 9) and using Dunn's test for the post-hoc pairwise comparisons. The p-values I get for the pairwise comparisons (unadjusted for multiple comparisons) are exactly half what I get in SPSS and GraphPad for the same data. The Kruskal-Wallis p-value reported by the dunn.test package is exactly what I get running the Kruskal-Wallis test itself in R, or in SPSS and Graphpad. There is a warning after I run my code that the dunn.test package was written on a slightly later version of R, but that seems unlikely to be the cause of a factor of 2 variation. Has anyone else come across a similar discrepancy?


What is the correct structure for the phrase 'only happens once'?

There is a statement on my homepage, and I'm not sure the correct order, or if it really matters.   "Your first impression only happens once."  Now should that be flipped around? i.e. ... happens only once.  Is there a correct order here?


Windows xp wont load after installing ubuntu

I installed Ubuntu alongside with xp. But the standard dual boot wasn't allowing me due to several partitions. So I installed it manually using the do something else option. Now everything said and done when I try to select windows from GRUB it doesn't boot it just shows a blank screen with a blinking icon. Have no idea what to do


How to merge an unallocated partition with an extended partition?

How can I merge an unallocated partition with an extended partition ? I'm having trouble moving this unallocated space to the Linux portion. Here is my partition space:  (source: )


Auto case number based on a specific record type?

We have around 10 case record types. We have one specific record type for our service cases. We want the cases to be assigned an auto case number whenever a new case is created. We do have a auto number field but it's updating for every case that is created.   Auto case number shouldn't be assigned when cases are created in other record types. For ex: If there are 8 cases under this record type, I want the 9th case to to have SR-009 as the custom case number instead of SR-020, assuming other record type cases are created. How do I achieve it?


I know that there are many similar questions on this site, but none of them helped me.  I have the following PHP code:  <?php $to = "mymail@inbox.com"; $from = "no-reply@heygee.com"; $subject = "Confirm your registration!"; $message = "Please follow this link to confirm your registration: www.bit.ly/32106";  $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers .= "From: HeyGee! <no-reply@heygee.com>" . "\r\n" . "Reply-To: mymail@inbox.com" . "\r\n" . "X-Mailer: PHP/" . phpversion();  $ok = @mail($to, $subject, $message, $headers, "-f " . $from);    ?>   Let's say mymail@inbox.com is my test e-mail. Whenever I send the mail to my address, I always receive the mail in my Spam folder. Why is that? Are there any corrections or tricks to be made to prevent the mail from arriving in Spam?  Thanks.


Declaring a visitor to the UK as my "girlfriend" - effect on getting a Visitor visa?

I have a Serbian girlfriend who I have visited in Belgrade 4 times now and she is planning a trip to the UK for her 2 weeks vacation in 2 months from now ().  When applying for this visa she must state the main reason for her visit, which is for her to see me and stay with me, also some travel to meet my friends and family etc. Thus, she must also state her relationship to me.  However, various people who have some experience of/heard stories about UK visa applications for such reasons are constantly telling us that we should never mention that I am her boyfriend or that she is my girlfriend, as she may then be refused. However, we plan to marry after my divorce (in process) is completed in 3-4 months time, so I do not under any circumstances wish to be deceptive so as to risk jeopardising our subsequent application for her to come here on a fiancée/marriage visa, as I read about .  Do the "rumours" hold any truth? Should we do as I suggest and declare that we are boyfriend/girlfriend? Is there anything specific we should be aware of to document and declare about our releationship for the initial Standard Visitor visa?


Logistic regression normality and homoscedasticity

Why does logistic regression not require residuals to be normally distributed and homoscedastic the way linear regression does?  Why does this not cause problems for estimating logistic regression models?


If two non-congruent circles with centres $A$ and $B$ intersect at $P$ and $Q$, then prove that among all lines drawn through $P$ and terminated by the circumference of two circles, the line which is parallel to $AB$ is the greatest.


Use javascript to find css auto height value

How can I use JavaScript to find out what is the value generated for auto height in css? I am using Grails and jQuery.  Example css:  .tool-preview {     height: auto; }


Meaning of $ and # symbols for normal and root user in terminal

What do the symbols mean # and $. Why # for root?  Where do these conventions come from?


My wife would like to visit Vatican City. We are from Canada. My wife has mobility issues and I was wondering if it is at all possible to stay at the Vatican, either at Vatican City itself or in one of the  places in Rome?   I know we can find places in Rome to stay, but I would like to know if we can stay at the Vatican as a pilgrim?


How to install adblock software via terminal

Is it possible to install AdBlock Plus, uBlock or something equivalent via terminal?   I am using Ubuntu 18.10 and want to install adblocking extension for Firefox 64. I could easily do that by launching Firefox and a few mouse clicks, but I need to repeat this operation on quite many computers and am seeking a way to automate it.


PGFPlots option to include/ignore data set when determining axis limits?

Is it possible to tell pgfplots whether or not to consider individual data sets when automatically determining axis limits, or call some sort of "maintain axes limits at their current values from now on" command?  Minimal Working Example:  \documentclass{article}  \usepackage{pgfplots} \pgfplotsset{compat=1.5}  \begin{document}  \begin{tikzpicture} \begin{axis}%     \addplot coordinates { (0,1) (1,2) (2,3) };%Automatically sizes axes (want)     \addplot coordinates { (0,1) (1,4) };%Automatically re-sizes axes (don't want) \end{axis}% \end{tikzpicture}  \end{document}   The application is plotting experimental results vs. simulation --- I want both data sets to be plotted always, but I'd like the experimental data to set the scale, even if the simulation results are extremely different.    I recognize that I could go through and hard-code a reasonable scale myself, but this is for a script that I'm running in batch mode with many different data sets, so it would be more convenient if I didn't have to write a whole other family of scripts for choosing reasonable axis limits.


Proof of inequality using AM-GM inequality

prove that $x^2 + y^2 + z^2 \ge xy + xz + yz$  I tried proving it the way I prove $x^2 + y^2 \ge 2xy$. But it just doesn't seem to work. I tried using AM-GM. Should I be using GM-HM or AM-HM? I really don't know what the problem is and I'd appreciate any help and a full proof explanation. Thanks.


An unhandled exception of type 'System.StackOverflowException' using AutoMapper with many to one Related Entities

After fixing this error:  I received  the error:  Cannot evaluate expression because the current thread is in a stack overflow state. Here is where I initially get the error (As you can see, it's the same line as the first error):    UPDATED: When I add the ignore statement to my CreateMap<>(); declaration:   CreateMap<Pages, PagesViewModel>()             .ForMember(m => m.PageTypes, x => x.Ignore())             .ForMember(m => m.SiteMap, x => x.Ignore())             .ForMember(m => m.Row, x => x.Ignore())             .ForMember(m => m.Tracks, x => x.Ignore());   I received this message: System.Reflection.TargetParameterCountException: Parameter count mismatch. So i removed the Ignore statement and the CreateMaps are as follow:  CreateMap<Pages, PagesViewModel>();  CreateMap<PagesViewModel, Pages>();   the error does one of the following (all three have happened and hard to reproduce a specific one):   The first one is the application just keeps running and eventually times out.   The program '[5256] iisexpress.exe' has exited with code -2147023895 (0x800703e9).  moves on to another part of the code (my PagesViewModel)   (UPDATED):  private string PagesURL; [Required] [Display(Name = "Page URL")] [DataType(DataType.Url)] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long and no longer than {1} characters.", MinimumLength = 2)] public string pagesURL {     get { return PagesURL; }     set { PagesURL = HttpUtility.UrlEncode(value); } }   When this third one comes up, I get the same error: Cannot evaluate expression because the current thread is in a stack overflow state.  I have tried separating out the code to see where and why it's doing this by trying the following:   List<Pages> getPages = db.Pages.ToList(); List<Pages> getPagesOrdered = getPages.OrderBy(o => o.pageOrder).ToList(); List<PagesViewModel> convertPages = new List<PagesViewModel>(); foreach (Pages item in getPages) {     PagesViewModel pagesViewModel = new PagesViewModel();      pagesViewModel.pageDescription = item.pageDescription;     //...loops through all other properties      convertPages.Add(pagesViewModel); }   It gets all Pages from the database context, orders it and declared the PagesViewModel fine BUT when it goes inside the for loop, it declares the pagesViewModel variable fine and then right after it, before it even jumps to the pagesViewModel.pageDescription = item.pageDescription; line the application crashed The program '[5176] iisexpress.exe' has exited with code 0 (0x0).  MrChief, in the answer I linked at the top, suggested it is how my models connect with each other that is causing this issue. For example, PagesViewModel connects to public virtual PageTypeViewModel PageTypes { get; set; } and PageTypesViewModel connects back to PagesViewModel public ICollection<PagesViewModel> Page { get; set; }  My model requires those be connected and it works fine without auto mapper (with the exception of me trying to set each variable manually which cause the application to crash). I'm stuck and would appreciate some insight.     UPDATE:  After going here:  a co-worker of mine was able to get us the symbols for AutoMapper so we can trace into that source code. We added a trace breakpoint to output what was actually causing the issue. Here is what it output a few hundred times:  From "Pages"."PageTypes" to "PagesViewModel"."PageTypes"  So MrChief's prediction was correct. Now how to fix this, I don't know.   This is where the PageViewModel links to the PageTypes view model: public virtual PageTypeViewModel PageTypes { get; set; } and then in PageTypesViewModel is links to PageViewModel: public ICollection<PagesViewModel> Page { get; set; }  This is how EF6 generated my model. I went about this doing model first.   I might have forgotten to include some important information so let me know if there is anything missing. Thank you in advance for the help.


i am using this wonderful tool that tkz-fct is for creating nice documents but I have a weird result from recently. This is my document :  \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{calc} \usepackage{color} \usepackage{pifont}                     %pour utiliser la police Ding \usepackage[left=1.5cm,right=1.5cm,top=2cm,bottom=2cm]{geometry} %marges du document \usepackage[french]{babel} \usepackage[usenames,dvipsnames]{xcolor} \usepackage[L]{thmbox} \usepackage{eurosym} \usepackage{enumitem}               %pour modifer itemize et enumerate \usepackage{amsmath,amsfonts,amssymb} \usepackage{mathrsfs}               %pour utiliser mathscr \usepackage{array,multirow,makecell} \usepackage{fancyhdr}               %package pour modifier les en-têtes \usepackage{fancybox}               %pour boîtes spéciales \usepackage{tikz,tkz-tab,tkz-fct} \usepackage{tikz-dependency}        %permet de créer des schemas \usepackage{sectsty}                %permet de modifier les styles des sections (voir \sectionfont l.21) \usepackage{fourier-orns} \usepackage{shadethm}               %pour theoremes en gris \setcellgapes{1pt} \makegapedcells \newcolumntype{R}[1]{>{\raggedleft\arraybackslash }b{#1}}   %pour redéfinir les colonnes dans tabular \newcolumntype{L}[1]{>{\raggedright\arraybackslash }b{#1}} \newcolumntype{C}[1]{>{\centering\arraybackslash }b{#1}} \renewcommand{\thesection}{\Roman{section}} %permet de changer la numérotation en chiffres romains des sections \newshadetheorem{defi}{Définition}  %crée un nouveau type de théorème \newshadetheorem{thm}{Théorème} \newshadetheorem{ppte}{Propriété} \sectionfont{\sectionrule{3ex}{3pt}{-1.5ex}{1pt}} %mettre un trait de séparation dans les sections (package sectsty) \pagestyle{fancy} %style en-têtes \lhead{} %en-tête gauche \chead{Lois à densité} %en-tête centrale \rhead{T\up{ale}} %en-tête droite \begin{document} \begin{tikzpicture}      \tkzInit[xmin=-4,xmax=4,ymax=1]      \tkzDrawX[label={},noticks]      %\tkzDrawY      \tkzFct[domain=-2:2]{exp(-x**2)}      \tkzDrawArea[color=blue, domain = -0.5:1]      \tkzText(-1,0.75){$\mathscr{C}_{f}$} \end{tikzpicture} \end{document}   But from now, it doesn't produce the result I would like as the surface start from the point (-0.5,f(-0.5)) and not as an integral from -0.5 to 1. This is a picture of the result :   Which is obviously not what I would like and this extends now to all my "old" docs which were "normal" before. I don't think I have done anything special except updating my Tex distribution ... If someone has an idea ??


Ubuntu won't detect Btrek H9 bluetooth headset anymore

I bought a bluetooth headset and Im trying to connect it to my ubuntu computer, the problem is, first time I tried it showed my device under Device Search but when I selected the device and then clicked next it said failed to connect and now it doesn't even show the device anymore, I have Ubuntu 15.04, the headset works fine with my phone.  These are some outputs:  victor@victor-G46VW:~$ pactl list short | grep -i bluetooth 7   module-bluetooth-policy      8   module-bluetooth-discover     victor@victor-G46VW:~$ uname -a; lspci -nnk | grep -iA2 net; lsusb; dmesg | grep -i bluetooth; dmesg | grep -i firmware; lsmod | grep bluetooth Linux victor-G46VW 3.19.0-47-generic #53-Ubuntu SMP Mon Jan 18 14:02:48 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 03:00.0 Network controller [0280]: Broadcom Corporation BCM4352 802.11ac Wireless Network Adapter [14e4:43b1] (rev 03)     Subsystem: AzureWave Device [1a3b:2123]     Kernel driver in use: wl 04:00.0 Ethernet controller [0200]: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet [1969:1083] (rev c0)     Subsystem: ASUSTeK Computer Inc. Device [1043:200f]     Kernel driver in use: atl1c Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 005: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader Bus 003 Device 004: ID 13d3:5188 IMC Networks  Bus 003 Device 003: ID 13d3:3404 IMC Networks  Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 046d:c526 Logitech, Inc. Nano Receiver Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub [    4.591161] Bluetooth: Core ver 2.20 [    4.591176] Bluetooth: HCI device and connection manager initialized [    4.591181] Bluetooth: HCI socket layer initialized [    4.591184] Bluetooth: L2CAP socket layer initialized [    4.591191] Bluetooth: SCO socket layer initialized [    4.643538] bluetooth hci0: Direct firmware load for brcm/BCM20702A0-13d3-3404.hcd failed with error -2 [    4.643543] Bluetooth: hci0: BCM: patch brcm/BCM20702A0-13d3-3404.hcd not found [    6.673533] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [    6.673536] Bluetooth: BNEP filters: protocol multicast [    6.673541] Bluetooth: BNEP socket layer initialized [    6.681066] Bluetooth: RFCOMM TTY layer initialized [    6.681073] Bluetooth: RFCOMM socket layer initialized [    6.681078] Bluetooth: RFCOMM ver 1.11 [    0.246266] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored [    1.615916] psmouse serio4: elantech: assuming hardware version 4 (with firmware version 0x460f02) [    4.643538] bluetooth hci0: Direct firmware load for brcm/BCM20702A0-13d3-3404.hcd failed with error -2 bluetooth             491520  22 bnep,btusb,rfcomm


How do I use grep to search for the string "-1"

I'm using grep in bash to search for the string "-1" .  I would usually search for "bar" like this ...  glaucon@foo $ grep -irn "bar"   ... which works fine but when I try to search for "-1" I get this ...  glaucon@foo $ grep -irn "-1" Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information.   ... I thought the minus might be a special character but it appears not . I also tried using the 'fixed strings' option in case this was some aspect of regex I was unfamiliar with ...  glaucon@foo $ grep -irnF "-1" Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information.   ... but, as shown, that doesn't provide output either.   I'm sure this is straightforward but ... how ?  Thanks


Find the sum of angles without trigonometry?

I have found the sum it's $180$ but using right triangle and sine theorem.


Tagged trees when 1,2,3 are leaves and the minum path between them >2

Let $V=(1,2,...,n), n>5$ be a set of vertices. How many tagged trees are there on V such that the vertices 1,2,3 are leaves and the minimum path length between every 2 of them is greater than 2?  What I've tried: I said that without 1,2 and 3 there are $(n-3)^{n-5}$ tagged trees on V without 1,2,3. So now we need to connect 1,2,3 to the tree with one edge each (so it will be a leaf) and it can't be the same vertex in the tree every time because this will result a length of 2.   So this will give: $(n-3)^{n-5}\cdot(n-3)\cdot(n-4)\cdot(n-5)$  Is this nonsense or somewhat correct?


The HDRI showed up fine in the preview, but didn't show up in the final cycles render. The transparent checkbox is disabled. The HDRI of the other window in the room (not shown) showed up accurately, both in the render and the preview. Both windows used the same glass texture. How does this happen? What should I do? Thank you. Environmental Texture:  Glass Texture for Window:


I want to proof the following: If an element $[a] \in \mathbb{Z}$/m$\mathbb{Z}$ is a unit, then $a$ and $m$ are coprime, i.e. $gcd(a,m) = 1$. Proof: Let $[a]$ be a unit and $[a]^{-1} = [b]$. $\implies ab \equiv 1 \pmod m$ $\implies$ there is a $q \in \mathbb{Z}$ with $ab = qm+1$ $\implies ab-qm = 1$ $\implies \gcd(a,m)=1$ My question is: What is the reason that I am able to conclude the last step - $gcd(a,m) = 1$. Is it why I can divide the whole equation $ab-qm=1$ by a maximum of 1, because when I divide the equation by a number $> 1$, the right-hand-side would be a fraction and that is not allowed since we are in $\mathbb{Z}$. That was my guess but I am not sure at all. Thanks for your answers.


Testing equality of variances without the data, just from the variances and the mean

Assume I have a physical system in which I am sampling data from either a binomial distribution with a $p$ of 0.5, or from an alternation between a $p$ of 0.25 and 0.75. But the result is such that in this case it appears $p = 0.5$ as well.  So lets say for example I do a 1000 coinflips and get 500 heads. So the $\hat{p}=0.5$. Now I want to determine the probability I am sampling from the static case rather than the alternating case by looking at the variance within the data. Because if in the first half of the coinflip series I had noticeably more heads than expected from $p=0.5$ and in the last part less, I want to be able to see that.  I have :   cut the dataset into $M$ windows of $n=5$ coinflips. for each of these windows, determine the number of heads. calculate the variance between these datasets.   Or formally: $Var[\hat{h}] = \frac{\sum_{i = 1}^{M} (h_i - \mu_i)^2}{M}$, where $h_i$ is the number of heads within a window of size $n=5$ and $\mu_i$ is the mean of the number of heads in such windows.  They then do monte-carlo simulations to calculate a 99.9% confidence interval for the static case in order to be able to say if the deviation is significant. But this is the part I don't like because the data is distributed binomially and Monte-Carlo is computationally expensive.  I was wondering if we could use our knowledge that under the null-hypothesis we are looking at a binomial static system instead, as such:   calculate the number of windows, e.g. $M=1000/5$. calculate the theoretical variance for each window -> $np(1-p)$ with $n=5$ and $p=0.5$. So this results in a constant of $\frac{5}{4}$ for each window. The variance for the entire dataset should therefore be $Mnp(1-p)$ since variances are additive. Therefore $Var[h]_{(theory)} = \frac{5M}{4}$ from theory.   I then have the theoretical variance $Var[h]_{(theory)}$ for the dataset assuming the data draws from a single binomial, and the 'measured' variance $Var[\hat{h}]$ from the actual data itself.  How do I now best test if these variances are significantly different? We already know that the means are identical, if this might help. And what's very important to me is that all I am presented with in the end are these two variances, $M$ and the observed $\hat{p}$. I do not want to have to access the actual raw data anymore because the calculations are expensive.  Is there a test that will help me draw the conclusion from this information? Things I found where F-test, Levene's test, Bertlett etc., but for the last two I get the impression we need to use the actual data again and the first is said to be valid only for normally distributed data.


A weird problem has appeared on my laptop running Ubuntu 16.04. I have 8 GiB RAM and 10 GiB swap area. It worked fine, programs were swapping fast from the SSD, the swapped memory were mostly memory leaks and forgotten mmap anyway... but then something broke it. I have no idea what, I have not noticed it immediately. But now, it swaps incredibly rarely.  The swap space is almost unoccupied, I can have 95% RAM usage and swap space is only 5% full. If RAM fills up, it rarely swaps anything out, it freezes instead, sometimes it recovers after killing a program, but way too often, I have to do a hard reset.  I have checked the swappiness property, but it is set to 60 and setting it to 100 changes nothing. I upgraded Ubuntu to version 17.04, but it didn't help.  If I run a process that takes a lot of memory and uses it actively, it appears to swap out the memory of this process (that just allocated it!), making the process freeze again soon to get back the memory shortly aferwards, in a never ending loop. Almost none of the swapped out memory remains swapped out for long, although I am pretty sure there is enough leaked memory and unused programs to swap.  Any ideas what might be wrong?


I'm writing a book in LaTeX. This is my output:   Is it possible to change the text "Capitolo" ("Chapter" in italian) with something else, for example "Experience"?  Thanks in advance  \documentclass[oneside]{book} \usepackage[italian]{babel} \usepackage[utf8]{inputenc} \usepackage{amsmath,amssymb,amsfonts} % Typical maths resource packages \usepackage{chemfig} \usepackage[version=3]{mhchem} \usepackage{graphics}                 % Packages to allow inclusion of graphics \usepackage{color}                    % For creating coloured text and background  \usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref}                 % For creating hyperlinks in cross references. It should be after the color package. The option colorlinks produces colored entries without boxes. The option citecolor=blue changes the default green citations to blue. \usepackage[   a4paper,   margin=12mm, ]{geometry} \usepackage{times}  \usepackage[T1]{fontenc}  \DeclareGraphicsExtensions{.pdf} \parindent 1cm \parskip 0.2cm \topmargin 0.2cm \oddsidemargin 1cm \evensidemargin 0.5cm \textwidth 15cm \textheight 21cm  \def\R{\mathbb{ R}} \def\S{\mathbb{ S}} \def\I{\mathbb{ I}} \makeindex   \title{Laboratorio di Chimica Organica II}  \author{\htmladdnormallink           % Puts a hyperlink on to the author's name {Marco Atzori}{} {\copyright 2018 }}   \date{ }  \begin{document} \maketitle  \addcontentsline{toc}{chapter}{Indice} \pagenumbering{roman} \tableofcontents \chapter{Identificazione di una sostanza organica incognita}\normalsize   %\addcontentsline{toc}{chapter}{Preface} \pagestyle{plain} La sostanza da identificare è la numero 24. Nell'identificazione di una sostanza organica incognita la prima analisi da eseguire è la ricerca di un eventuale carattere acido o basico. A tale scopo, se ne verifica la solubilità in tre soluzioni acquose: HCl al 10\%, NaOH al 10\%, e $\ce{NaHCO_{3}}$ al 10\%. La sostanza non risulta avere un carattere acido perché non è solubile in acido cloridrico, mentre lo è in idrossido di sodio. A questo punto, bisogna ricavare una stima della forza dell'acido che si vuole identificare: la sostanza non è solubile in bicarbonato di sodio. Il saggio per l'identificazione dei fenoli con $\ce{FeCl_{3}}$ ha dato esito negativo, quindi un primo indizio è che si tratti di un acido carbossilico debole, presumibilmente aromatico. \pagestyle{headings} \pagenumbering{arabic}  \include{ch1} \include{ch2}  \include{index}  \addcontentsline{toc}{chapter}{Index} \end{document}


I want to compute the following integral: $$\raise 1ex{\Large\int} \frac{\sqrt{\ln(x+\sqrt{1+x^2}})}{1+x^2}\,dx$$


How to use the Extended Euclidean Algorithm manually?

I've only found a recursive algorithm of the extended Euclidean algorithm. I'd like to know how to use it by hand. Any idea?


Retrieve point coordinates from map canvas using QGIS API

I'm trying to build a plugin that firstly captures the map coordinates.  I have tried to adapt the map tool explained in this post:   The code I used for the main function is below:  def canvasReleaseEvent(self, event):     #Get the click     x = event.pos().x()     y = event.pos().y()      canvas = self.canvas     canvas.mapRenderer().setProjectionsEnabled(True)     canvas.mapRenderer().setDestinationCrs(QgsCoordinateReferenceSystem(27700))     espg = canvas.mapRenderer().destinationCrs().authid()      point = self.canvas.getCoordinateTransform().toMapCoordinates(x, y)   Unfortunately the when I print point it always returns as (0,0). I have tried various ways to set the crs of the points but none work.  What needs to be done to make it work?


I learn Lotka-Volterra model in computing mathematics textbook and solve it by different numerical methods.   $$ \frac{1}{x}\frac{dx}{dt} = a - by$$ $$ \frac{1}{y}\frac{dy}{dt} = cx - d$$  where, $a,b,c,d \in \mathbb{R}$  But I am trying to solve it by myself, and I can't work it out.  Particularly, I don't know how to deal with $$ \log x = \int_{0}^{t} (a - by) dt $$  where $y$ is also a function of $t$.


Image of Intersection of sects not equal to intersection of images of sets

How to disprove, if $f$ is a function,  $f(A \cap B) != f(A) \cap f(B)?$