I created a program that calcuates the average acceleration using 3 inputs.  Here's my code:      Scanner input = new Scanner(System.in);      System.out.print("Enter v0, V1, and t:  ");     double v0 = input.nextDouble();     double v1 = input.nextDouble();     double t = input.nextDouble();      double acceleration = (v1 - v0) / t;      System.out.println("The average acceleration is " + acceleration);   Here's the output:     Enter v0, V1, and t:  5.5 50.9 4.5   The average acceleration is 10.088888888888889   Here's the expected output:       Enter v0, V1, and t:  5.5 50.9 4.5   The average acceleration is 10.0889   I'm not quite sure how to trim the excess 8's in my code.  I tried casting acceleration into a float and that somewhat works, but there is still too many 8s with it.


I did 'ifdown eth0' and...I can't connect my instance

I should have run ifdown eth0 && ifup eth0, but I just ran ifdown eth0. Can I connect to my instance and run ifup eth0? What should I do?


Oscilloscope: How are Bandwidth specification and Sampling Rate related?

I had thought that a (digital) Oscilloscope with higher Sampling Rate,  would automatically have higher Bandwidth. That seems intuitive because of Nyquist Sampling Theorem. But I've read in several places that in an Oscilloscope "sampling rate is not directly related to the bandwidth specification" (see  for example). That doesn't make any sense to me. Could you explain the logic?


Consider the congruence $x^2 − 1 \equiv 0 \pmod{8}$. How many solutions does it have with $0 \le x < 8$?

Just by plugging in numbers, I know that there are 4 solutions: X = 1, 3, 5 and 7. I'm not sure if I need to show additional steps or if I can just write my answer as it is.


Autocad DXF to Qgis and exporting to KML for viewing in Google Maps

/ Background: I have a DWG trace made in AutoCad using Gauss-Kruger coordinate system ( a CRS used in Slovenia ). I'm using AutoDesk Map 3D to transform the coordinate system to WGS84.PseudoMercator EPSG:3857 which is required by Google to show traces on maps. /  I saved the drawing as DXF file, opened it in QGIS, set both project and  layers as WGS84.PseudoMercator EPSG:3857 CRS, enabled 'on the fly CRS transformation' and exported the layers to a KML file (Google format) and tried opening them in Google Maps.  However, the trace is shown in the ocean near Nigerian coast instead of Slovenia.   I also tried opening shapefiles in qgis in viewing the trace with OpenLayers plugin but it makes no difference.  I'm new to this software and CRS.


String userID = FirebaseAuth.getInstance().getCurrentUser().getUid(); (getUid give null pointer exception

“I’m setting a map activity where i  get updated location in real time database fire base  but not show location in fire base .when i logged in my app then  driver map activity open  and app crashes. I see log cat error show null pointer exception.  error on first line getUid()   ( 168 line  no)     private void DisconnectTheDriver() {      String userID = FirebaseAuth.getInstance().getCurrentUser().getUid();     DatabaseReference DriverAvailibiltyRef = FirebaseDatabase.getInstance().getReference().child("Drivers Available");      GeoFire geoFire = new GeoFire(DriverAvailibiltyRef);  (175 line no)        geoFire.removeLocation(userID);   }   In logcat    at android.os.Handler.dispatchMessage(Handler.java:105)     at android.os.Looper.loop(Looper.java:164)     at android.app.ActivityThread.main(ActivityThread.java:6942)     at java.lang.reflect.Method.invoke(Native Method)     at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.firebase.auth.FirebaseUser.getUid()' on a null object reference     at com.example.uolbuses.DriverMapActivity.DisconnectTheDriver(DriverMapActivity.java:275)     at com.example.uolbuses.DriverMapActivity.onStop(DriverMapActivity.java:268)     at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1382)     at android.app.Activity.performStop(Activity.java:7452)     at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4238)     at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4290)      at android.app.ActivityThread.-wrap25(Unknown Source:0)      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1730)      at android.os.Handler.dispatchMessage(Handler.java:105)      at android.os.Looper.loop(Looper.java:164)      at android.app.ActivityThread.main(ActivityThread.java:6942)      at java.lang.reflect.Method.invoke(Native Method)      at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)


Bubble sort in Fully Homomorphic Encryption

I've read in a pdf written by Ayantika Chatterjee and Khin Mi Mi Aung whose title is "Fully Homomorphic Encryption in Real World Applications" that it is possible to implement a bubble sort algorithm using certain Fully homomorphic libraries to be able to compare and sort messages while they are encrypted, here is a snippet of the pdf:  The FHS circuit depends on two main operations: subtraction operation and decision making based on the subtraction result. Fully Homomorphic subtraction, which is implemented by performing homomorphic addition of one ciphertext with 2’s complement of another ciphertext. For two plaintext numbers a and b, subtraction can be computed as: a − b = a + 2’s complement of b   Now a homomorphic subtraction of a' and b' which are the encryptions of a and b respectively is computed using the homomorphic addition as follows: a' − b' = a' + Encrypt(2’s complement of b) The 2’s complement of b in the encrypted domain is obtained as follows: Encrypt((2's complement of b), pk) = b' ⊕ Encrypt(11 . . . 1, pk) ⊕ Encrypt(1, pk)   They also say that:  The MSB (most significant bit) of the substraction output is further fed to the decision making module as a selection line. The following equations represent how the swap operation takes place between two elements A[i] and A[i + 1] depending on MSB (represented here as bt): temp = bt ∗ A[i] + (1 − bt) ∗ A[i + 1] A[i + 1] = (1 − bt) ∗ A[i] + bt ∗ A[i + 1] A[i] = temp   So they make very clear that its the MSB of the substraction that determines which encrypted message is the biggest/smallest.  So my question is how were they able to determine that is only the MSB which determines the answer because i know that if we have the number 2 which is smaller than the number 3 after encryption we don't have a guarantee that Enc(2) is smaller than Enc(3)


How do I install the Ask Ubuntu Unity Lens, and how do I use it?

I heard about the  over in the , and I was wondering how to install it. What are the step-by-step instructions to get it installed, activated and once that's done, how do I use it?


(EDIT: I've marked this question as answered in order that I can go away and come up with a better one. Thanks to everybody for the helpful answers.)     Is it possible to describe the RH in language comprehensible to a non-mathematician?   In my experience (as a non-mathematician) the answer is a definite 'no'. But before I give up on it I thought I'd ask for some views.   By 'explain' I do not mean explain fully. I mean explain the basic structure of the hypothesis. Something like - we feed values into a function and the output is plotted to create a landscape and a critical line appears and we conjecture that all zero outputs fall on this line. I expect even this is wrong but it's this level of explanation that I'm after, with just a bit more detail added.   I've spent a long time trying to understand the relationship between the inputs and outputs of the Zeta calculation and got nowhere. Yet I'm not stupid. There's something I'm missing but none of the explanations I've been offered allow me to understand what it is.             I know a bit about the primes but must ask for answers in a more or less natural language or will not be able to cope. I know such requests annoy mathematicians but I can only ask.  I have read Du Sautoy, Derbyshire and much more but never found an explanation that doesn't assume I'm a graduate mathematician. I need a children's book on the topic that describes it in very general terms.  Is such a thing possible?    EDIT: Vincent has suggested a similar but perhaps interestingly different question. This is - is there an intuitive explanation why the Riemann zeta FUNCTION (rather than hypothesis) contains interesting information about the distribution of primes in language comprehensible to a non-mathematician?    My intuition is that the explanation would be the harmonic series and its role in determining the distribution of primes. I'll hesitatingly ask if this makes any sense. Or are there other reasons? As it happens I'm coming at this as a musician and have an interest in the musical aspect of the distribution or primes, or rather in the distribution of non-primes that determines the primes.             EDIT 2: I see that similar questions have been asked previously. Thanks to the members who have provided links to them. I've been checking them and so far they have been helpful but not so much as to persuade me to take this one down. This may change as I keep reading and I'll withdraw this one if so.


An n×n matrix M of integers has the property that Mab=Mxy iff a+b=x+y. How many distinct elements are there in M?


Why is this toArray() method not working?

I am making a simple blackjack program in java, in which there is a Dealer class that extends the Player class. The problem in the code below is that when calling the Player.hit() method is called, I get an error saying this: Exception in thread "main" java.lang.NullPointerException: Cannot read the array length because "a" is null Here's the code for the player class: package Blackjack;  import java.util.ArrayList; import java.util.Scanner;  public class Player {     private ArrayList<Card> hand; //users hand     private int handvalue = 0;     private String name;     private Card[] aHand;     Player(ArrayList<Card> hand, String name){         this.hand = hand;         this.name = name;     }     public void addCard(Card card){         hand.add(card);     }     public boolean hasBlackjack(){         if (handvalue == 21){             return true;         }         else{             return false;         }     }     Scanner input = new Scanner(System.in);     public String hitOrStand(){         System.out.println("Would " + name + " like to hit or stand?\n");         String choice = input.nextLine();         return choice;     }     public int calcHandValue(ArrayList<Card> hand){         aHand = hand.toArray(aHand);         int handvalue=0;         for(int i=0; i<aHand.length; i++)         {             handvalue += aHand[i].getValue();             if(aHand[i].getValue()==11)             {                 System.out.println("You have drawn an ace. Would you like it to be worth 11 or 1?");                 int acevalue = input.nextInt();                 if(acevalue == 1){                     aHand[i].value = 1;                 }             }         }         return handvalue;     }     public boolean checkBust(){         if (handvalue > 21){             System.out.println(name + " has busted!");             return true;         }         return false;     }     public void hit(Deck deck)     {         hand.add(deck.drawCard());         aHand = hand.toArray(aHand);         handvalue = 0;         for(int i=0; i<aHand.length; i++)         {             handvalue += aHand[i].getValue();             if(aHand[i].getValue()==11)             {                 System.out.println("You have drawn an ace. Would you like it to be worth 11 or 1?");                 int acevalue = input.nextInt();                 if(acevalue == 1){                     aHand[i].value = 1;                 }             }         }     }      public String getName() {         return name;     }      public ArrayList<Card> getHand() {         return hand;     } }


How to use "grep" command to find text including subdirectories

I want to find all files which contain a specific string of text. The grep command works, but I don't know how to use it for every directory (I can only do it for my current directory). I tried reading man grep, but it didn't yield any help.


Image size enlarged without losing quality

Is there a way to enlarge a photo and not lose image quality


Why is search keyword going across apps on a Mac?

I just found out if a keyword is searched inside of Google Chrome on a Mac, then if I go to the Terminal app and search there, the keyword will go across there.  That is different from what I know before: each app's search is independent and they would not go across. How come it is happening and is there a way to make them independent?  (this Mac is still running Mavericks but I am wondering if High Sierra is doing the same thing)


How scientists can be confident that human embryo tail is really a tail?

From :     Human embryos have a tail that measures about one-sixth of the size of the embryo itself. As the embryo develops into a fetus, the tail is absorbed by the growing body.   How are we sure that it is a real tail and is not a superficial resemblance of something else?  I ask this because some creationist guy challenged me in this regard.


Overflow causes partially visible tag names on /users with long tag names

On the /users page, the top tags responsible for the bulk of your reputation gains are shown underneath your username and reputation for that selected period. In the instance that your tag names are long this can cause a pretty ugly overflow issue resulting in partially visible tag names, as follows:    This issue is currently(!) , showing reputation, filtered down to this current week.


Suppose we uniformly and randomly select permutations from the 20!   Permutations of 1, 2, 3,..., 20.  What is the probability that 2   appears at an earlier position than any other even number in the   selected permutation?   A. 0.5  B. 0.1 C. 9! / 20! D. None   According to the work book the answer is (D)  However am getting the answer as 0.1  Here goes the explanation.   The first even number is 2.  Selection of these numbers is analogies to arranging them in 20 blanks.    Suppose 2 is filled in the first blank. then the remaining 19 elements can be arranged in 19! Ways.  Suppose 2 goes into the second blank. The 1st blank can be occupied by an odd number in 10P1 ways and the 2nd blank can be filled with 2 in 1 way while the remaining 18 blanks can be filled in 18! Ways  Hence (10P1)(1)(18!) ways Suppose 2 goes into the third blank. The 1st two blanks can be occupied by two odd number in 10P2 ways and the 3nd blank can be filled with 2 in 1 way while the remaining 18 blanks can be filled in 17! Ways  Hence (10P2)(1)(17!) ways   Generalizing the above three steps.      For i = 0 to 10      Summation of      (  10Pi )(1)(19 - i )!    Evaluating the above summation in the calc, I got 1/10 = 0.1  Let me know if I missed anything in the calculation.


I would really like something like  * First Bullet   * third Bullet * Second Bullet  * Fourth Bullet   I've tried using tabular and itemize, but \item does not show the bullet.  How can I achieve this?


I'm trying to make the table take the line width of the paper but I don't know how to do this. I want it to look like this:    However, it's appearing like this:    This is the script I used:  \begin{table*}[htbp]   \centering   \caption{Add caption}     \begin{tabular}{rlrr}     \toprule     \multicolumn{1}{l}{\textbf{E}} & \textbf{A} & \multicolumn{1}{l}{\textbf{B}} & \multicolumn{1}{l}{\textbf{C}} \\     \midrule           & \textbf{q} & 0     & 0 \\     \multicolumn{1}{l}{\textbf{X}} & \textbf{w} & 0     & 0 \\           & \textbf{e} & 0     & 0 \\           & \textbf{r} & 0     & 0 \\     \multicolumn{1}{l}{\textbf{Y}} & \textbf{t} & 0     & 0 \\           & \textbf{y} & 0     & 0 \\           & \textbf{u} & 0     & 0 \\     \multicolumn{1}{l}{\textbf{Z}} & \textbf{i} & 0     & 0 \\           & \textbf{o} & 0     & 0 \\     \bottomrule     \end{tabular}%   \label{tab:addlabel}% \end{table*}%


What do we call the machine used in shops through which we swipe our Debit/Credit card to pay for something?

When you shop for things in a supermarket, clothing shop, restaurant, etc., and you want to use your card to pay, you slide your Debit/Credit card through a machine. What is that machine called in English?


We learned in school that in English always "adjective +noun".But in "Cyrus the great" or "Alexander the great" is "noun+the+adjective". What is the name of the phrase? When could we use that phrase?


Show a sequence of R-modules and R-homomorphisms is exact.

Suppose given a exact sequence, $$0 \to A\xrightarrow{\enspace f\enspace} B\xrightarrow{\enspace g\enspace} C\to 0$$ I want to show the sequence,$\DeclareMathOperator{\Hom}{Hom}$  $$0→\Hom_R(N,A) \xrightarrow{\enspace f_*\enspace}\Hom_R(N,B)\xrightarrow{\enspace g_*\enspace} \Hom_R(N,C)$$ is also exact.  Here $f_*:\Hom_R(N,A)\to \Hom_R(N,B)$ is defined to be, $$f_*:f\mapsto h\circ f$$where $h$ is a $R$-homomorphism from $A$ to $B$.  I'm having trouble proving exactness at both points. Please help. Thanks!


I just bought a wired mac keyboard. Where I would expect numlock to be, it has a key with this mysterious symbol on:  ⌧ (a rectangular box with a cross through it)  What is this button?


I'm planning to implement an ecs system for my game but i have foreseen a problem.  How will a rendering system be able to render entities in the correct order based on their depth component?  What are some of the ways that this can be accomplished?  One way i can think of is sorting the components array by depth of but this can be tricky especially if using a mega array of components for all entities.  I'm using python but i might want to make the ecs in rust.


Exponential and Natural Log Power Series

I am asked to prove $$e^{Y\log(1+Z)} = (1+Z)^Y$$ using power series definitions for both the exponential function and natural log.  I am really stumped on this.  Our hunt was using the nth derivative of the power series $e^{Y\log(1+Z)}$ and determine the coefficient on $Z^n$ but I am really stumped.  Please help


Is there any tool for converting from .pdf to .chm?

I googled this title and all I encountered was chm -> pdf searches. Isn't it possible from pdf to chm ? Or if it is possible which tools do this ?


Add NDVI Date to stacked image in Google Earth Engine

I have created an Image collection in GEE, and I have computed NDVI index and mapped in each Imagen from Collection. Later, I create another collection with NDVI as a band, an finally Statacked in a Imagen each NDVI band. BUT the question is: how add the NDVI´s DATES in each band of the Stacked Image? function addNDVI(image) {   var ndvi = image.normalizedDifference(['B5', 'B4']).rename('ndvi')   return image.addBands([ndvi]) } var collection = ee.ImageCollection ("COPERNICUS/S2_SR")   .filterBounds(geometry)   .filterMetadata ("CLOUDY_PIXEL_PERCENTAGE", "Less_Than", 30)   .map(addNDVI)  print(collection)  var Coleccion_ndvi =  collection.select(["ndvi"]) print(Coleccion_ndvi)  var stackCollection = function(collection) {   var first = ee.Image(collection.first()).select([]);   var appendBands = function(image, previous) {     return ee.Image(previous).addBands(image);   };   return ee.Image(collection.iterate(appendBands, first)); }; var stacked = stackCollection(Coleccion_ndvi); print('stacked image', stacked);


Output from ls has newlines but displays on a single line. Why?

I think I may be overlooking a relatively fundamental point regarding shell. Output from the ls command by default separates output with newlines, but the shell displays the output on a single line.  Can anyone explain this to me? I had always presumed that the output was simply separated by spaces, but now that I see the output separated by newlines, I would expect the output to be displaying on separate lines.  Example:  cpoweradm@debian:~/lpi103-4$ ls text* text1  text2  text3   od shows that the output is separated by newlines:  cpoweradm@debian:~/lpi103-4$ ls text* | od -c 0000000   t   e   x   t   1  \n   t   e   x   t   2  \n   t   e   x   t 0000020   3  \n 0000022   If newlines are present, then why doesn't the output display as:  text1  text2 text3


Is it save for my 13-year-old daughter to bike to school alone?

My 13-year-old daughter wants to bike to school alone two times a week for band. It's about a 10 minute bike ride with crossing four roads. My husband is scared, but she is very mature and can bike very well. Do you think to let her bike alone with good bike lanes and safe neighborhoods would be save?


I would like to compute $G$ defined as follows  $$G(t):= \exp(-\int _0^t h_s~ ds )$$ with $h$ being a geometric Brownian Motion.  For that I would need first to compute $$\int_0^t e^{(\mu-\sigma^2/2)s+ \sigma W_s }~ ds$$ and know its law.   All I could figure out (that was not much) is that one can obtain all the moments by deriving the Laplace Transform and making the Laplace coefficient tends to zero witch is pretty straightforward  Could someone give me a help with that ? Any advice is appreciated.      Note that this question is not a duplicate since my question is to   compute the exponential of an integral of a geometric   Brownian motion and to compute the integral of the GBM itself.There is no expected value involveld   Many thanks


French Characters are not saving in database via php

I am using the MySQL and PHP to save posts into database. But when i write French language or any other characters in Description. It is not saving it. But Simple text is Saving perfectly.  This is my Connection file  DEFINE('DATABASE_USER', 'db_user'); DEFINE('DATABASE_PASSWORD', 'db_password'); DEFINE('DATABASE_HOST', 'localhost'); DEFINE('DATABASE_NAME', 'db_name');  date_default_timezone_set('UTC');  ini_set('SMTP', "mail.myt.mu"); // Overide The Default Php.ini settings for sending mail   //This is the address that will appear coming from ( Sender ) define('EMAIL', 'k4baber@hotmail.com');  /*Define the root url where the script will be found such as http://website.com or http://website.com/Folder/ */ DEFINE('WEBSITE_URL', 'http://haitibravo.com');   // Make the connection: $dbc = @mysqli_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD,     DATABASE_NAME);  if (!$dbc) {     trigger_error('Could not connect to MySQL: ' . mysqli_connect_error()); }   I tried mysqli_real_escap() also $desc = mysqli_real_escape_string($_REQUEST['description']); But it is not saving at all . The HTML Form submits all the information to this File..  if(isset($_REQUEST["submit"])){          $name = $_REQUEST['name'];         $category = $_REQUEST['category'];         $subcategory = $_REQUEST['items'];         $desc = $_REQUEST['description'];         $keywords = $_REQUEST['keywords'];         $address = "NULL";         $state = "NULL";         $city = $_REQUEST['city'];         $zones = $_REQUEST['zones'];         $country = $_REQUEST['country'];         $postcode = "0000";         $phone = $_REQUEST['u_phone'];           $image_name1 = $_FILES['image1']['name'];         $image_size1 =$_FILES['image1']['size'];         $image_tmp1 =$_FILES['image1']['tmp_name'];         $image_name1='prog'.rand().$image_name1;         move_uploaded_file($image_tmp1,'add_images/'.$image_name1);            $image_name2 = $_FILES['image2']['name'];         $image_size2 =$_FILES['image2']['size'];         $image_tmp2 =$_FILES['image2']['tmp_name'];         $image_name2='prog'.rand().$image_name2;         move_uploaded_file($image_tmp2,'add_images/'.$image_name2);          $image_name3 = $_FILES['image3']['name'];         $image_size3 =$_FILES['image3']['size'];         $image_tmp3 =$_FILES['image3']['tmp_name'];         $image_name3='prog'.rand().$image_name3;         move_uploaded_file($image_tmp3,'add_images/'.$image_name3);          $price = $_REQUEST['price'];         $date = date('Y-m-d');         $u_id = $_SESSION['u_id'];         $u_name= $_SESSION['u_name'];         $status= "0";         $flag = "0"; $mysql_query = "INSERT INTO `bravo_ads`(`ad_title`, `ad_category`, `ad_sub_cat`, `ad_description`, `ad_keywords`, `ad_address`, `ad_state`, `ad_city`, `ad_zone`, `ad_country`, `post_code`, `ad_img_1`, `ad_img_2`, `ad_img_3`, `ad_price`, `u_id`, `u_name`, `u_phone`, `ad_date`, `ad_status`, `flag`) VALUES ('$name','$category','$subcategory','$desc','$keywords','$address','$state', '$city', '$zones','$country','$postcode','$image_name1','$image_name2','$image_name3','$price','$u_id','$u_name', '$phone', '$date','$status','$flag')";          $query_OK = mysqli_query($dbc, $mysql_query);          if($query_OK){             $message = '
Operation avec success...! Votre produit a bien été posté . Il sera publié après approbation Administrateur
';          }else{              $message = '
Operation échoué...! Desoler, Votre produit nas pas ete afficher . Quelque chose a mal tourné . Veuillez réessayer plus encore
';         }}   $desc, $name, $keywords These things creates issue when i try to save


From my understanding, neural networks are universal approximators, which was proven by Cybenko in 1989 for sigmoid activation functions with output units being linear. Castro showed, that this property also holds true even if the output is not linear, but is a squashing function (non-decreasing with values in $[0,1]$). But did someone manage to prove that this property is also true for modern NNs with ReLU activations? I'm quite new to this topic and I haven't been able to find such work, I'd be grateful for your help.


How to view all the Symbolic links,Junction points,Hard links in a Folder using dir?

The command dir /a displays a list of all the files,folders in a given location. But it displays the type  for Junction Points as well as Symbolic Links to Folders. Is there any command which will differentiate and tell me which of these  are Junction Points and which are Symbolic links as well as which of the files are hard links ?


Can we use singular countable nouns after "any"?

Which one is correct ?  1.A. There isn't any student in the class.  1.B. There aren't any students in the class.  how is that in questions?  2.A. Is there any student in the class?  2.B. Are there any students in the class?


I was watching this:                                and it occurred to me, is Leia even classified as a Disney Princess now?  I'm aware she may not be included or merchandised in the "family" in the same way, but I'm curious as to her classification.


Is there a way to view edits made to comments to a reply?

Possible Duplicate:          Is there any way to view edits made to comments to a reply ? For example if someone modify one of their comments, can the original be seen ?


Are number fields safe to insert in database?

I've read plenty that you need to check and sanitize form data before inserting into database or using in an sql query and I agree with that. But I couldn't find an answer to this, if I only have a number field in my form:   <input type="number" class="form-control" name="max-persons" required>   Do I need to sanitize this? The user can only enters numbers as far as I know.  $maxPersons = $_POST['max-persons']; // or $maxPersons = mysqli_real_escape_string($connect, $_POST['max-persons']);   I'm here concerned about SQL injections here primarily.  Edit: I do not believe this is an exact duplicate of linked question. I'm not asking how to prevent SQL injection. I'm asking SHOULD I take steps to prevent SQL injection in case of number fields.


I fail to comprehend the difference in the meaning implied by the following statements:   Page had played the guitar. (Past perfect) Page was playing the guitar. (Past Progressive) Page played the guitar (Simple past) Page had been playing guitar for a long time. (Past Perfect Progressive)   Can somebody shed some light ? All appear to imply that guitar was played by Page. Is there any additional temporal information that each provides us with ?


How I use Google Input tools offline in Ubuntu

How I use Offline version of google input tool... If not then help me to develop the tool like Google input tool


Hotlinking: what is it, and why shouldn't people do it?

What exactly is hotlinking? And why do people say you shouldn't do it?


Is it possible to apply textures in Blender 2.8?

I'm following along with Blender's docs, trying to apply a texture to a object's surface. The docs for  appear to show screenshots of an older version of Blender (perhaps 2.79?), and point to menu items which don't exist in 2.82, such as "Use Alpha in the Map Image panel", and "UV from the Coordinates menu".  points to the "node system" and indicates that "legacy textures" are no longer supported.  Can textures still be applied using Blender? Was this functionality removed in 2.82, or is it undocumented? Is there documentation available for 2.82, or a better user manual available somewhere?


Query to collect the recent TimeSampled row using inner joins in MS SQL

I have written below inner join query to get the data from my database tables. But  output of this data is coming up with almost 140+ lines. Output is below. I need data in only one row with the most recent value by "TimeSampled"    select DisplayName, ObjectName, CounterName, InstanceName, SampleValue, max(TimeSampled) as TimeSampled from PerformanceDataAllView pdv with (NOLOCK) inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId where ObjectName = 'Processor'  AND TimeSampled >= DATEADD(MINUTE,-5,GETDATE()) AND DisplayName Like 'BLRW1ETST01.jcp.com' AND CounterName = '% Processor Time' GROUP BY DisplayName, ObjectName, CounterName, InstanceName, SampleValue ORDER BY  TimeSampled desc   How I can retrive results with only last Time Sampled row with respect to DisplayName. I have multiple servers (DisplayName) like this to retrieve the data.  Thanks, Ramu Chittiprolu


I often find that I see something and I flag it up, but then the post is edited and I want to undo my flag.  So I think that a feature which would allow for you, at least within the first 5-10 minutes of taking the action, to reverse it.


equality of two float numbers in for loop

What I am trying to do here is, I am taking a precision value (less than 1) and printing count of all the numbers of type 1/n (n is natural number) which are greater than or equal to the precision value (input).  #include <stdio.h>  int main(){     int i=1,terms=0;     float n;     printf("Enter precision value : ");     scanf("%f",&n);      while(i>0){         if ((1.0/i) >= n){             printf("%f\n",1.0/i);             sum = sum + (1.0/i);             terms++;             i++;         }         else             break;     }     printf("number of terms : %d\n",terms);     return 0; }   But if I give input 0.1 than the count (output) is showing only 9. but it should show 10 (it is not including 1/10).  I was using a for loop before and I know that breaking a loop with an if-else statement is not the best thing.


Leaflet+GeoJSON: Why are lat-lng coordinates in the wrong order?

I'm coding an app with Phonegap, which requests user's current position. As an overlay I have loaded a geojson layer. I want the app to automatically extract a value of said layer at the exact location, where the user currently is (without the user manually clicking on the layer).  I've tried Leaflet PIP extension, but couldn't get it to work with leaflet 1.0.3. I've also tried simulating a touch/mouseclick event at screen coordinates, but that didn't work either.  I've found the extension Leaflet.PointInPolygon, which can check, if a point is lying within a polygon. Therefore a transformation from geojson to an array with coords is required.  I wrote the following code to parse my geojson and write it into arrays to add polygon layers to my map (in order to check later, if map.getCenter() coords are within any of these):  var coord = []; for (var i = 0; i < data.features.length; i++) {   feat = data.features[i];    for (var j = 0; j < feat.geometry.coordinates.length; j++) {     coord = feat.geometry.coordinates[j];      var polygon = L.polygon(coord, { color: "red" }).addTo(map);   } }   I'm facing the prolem now  that lat and lon are in the wrong order:  [[10.77932197941255,52.03584196145097],[10.77932197941255,52.03575906909681],[10.779636389761993,52.03575906909681],[10.779636389761993,52.03584196145097],[10.77932197941255,52.03584196145097]]   How can I fix this?  Is there maybe a leaflet extension or javascript framework, which can directly check, if given coordinates are within a geojson object?


How to position the paper's authors' addresses on the front page (maketitle)?

When I use the following code for the title page of a paper (please see below), the authors' addresses and emails appear on the last page of the paper. However I need them to appear on the first-title page (after the authors' names before the abstract). How can I do this?  \documentclass [reqno, 12pt ]{amsart} ... \begin{document}  \title[paper]{Nice paper}  \author{Me} \address{University} \email{mmm@lala.com} \thanks{.} \author{my friend} \address{Institute} \email{kkk@lala.edu} \thanks{.}  \date{\today} \keywords{XXX }  \begin{abstract} Lalala \end{abstract}  \maketitle


\listoftheorems: space between numbers and text?

I'm making long index lists of theorems, definitions, etc, and the numbers overlap with the text in the list - here's an example:  \documentclass[a4paper]{report} \usepackage[english]{babel} \usepackage[margin=2cm]{geometry} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} \usepackage{stix} \usepackage{mathtools} \usepackage[document]{ragged2e} \usepackage{wasysym} \usepackage{booktabs} \usepackage{enumitem} \usepackage{pgfplots} \usepackage{tikz} \usepackage{float} \usepackage{thmtools} \usepackage{mdframed} \usepackage{etoolbox}  \usetikzlibrary{arrows,bending,calc,patterns}  %\newcommand\irregularcircle[2]{% radius, irregularity %   \pgfextra {\pgfmathsetmacro\len{(#1)+rand*(#2)}} %   +(0:\len pt) %   \foreach \a in {10,20,...,350}{ %       \pgfextra {\pgfmathsetmacro\len{(#1)+rand*(#2)}} %       -- +(\a:\len pt) %   } -- cycle %}  \newfloat{diag}{htbp}{dia}[section] \floatname{diag}{Diagram}  \makeatletter \everymath{\if@display\else\thickmuskip=2mu plus 2mu\fi} \renewcommand*{\listof}[2]{%     \@ifundefined{ext@#1}{\float@error{#1}}{%         \@namedef{l@#1}{\@dottedtocline{1}{1.5em}{3em}}% <-------  replaced 2.3em with 3em here         \float@listhead{#2}%         \begingroup\setlength{\parskip}{\z@}%             \@starttoc{\@nameuse{ext@#1}}%         \endgroup}} \patchcmd\thmt@mklistcmd     {\thmt@thmname}     {\check@optarg{\thmt@thmname}}     {}{} \patchcmd\thmt@mklistcmd     {\thmt@thmname\ifx}     {\check@optarg{\thmt@thmname}\ifx}     {}{} \protected\def\check@optarg#1{%     \@ifnextchar\thmtformatoptarg\@secondoftwo{#1}% } \makeatother  \declaretheoremstyle[ spaceabove=6pt,  spacebelow=6pt, headfont=\normalfont\bfseries, postheadspace=1em, notefont=\bfseries, notebraces={(}{)}, bodyfont=\itshape ]{thmstyle}  \declaretheorem[style=thmstyle,name=Definition,numberwithin=section]{mydef}  \begin{document}     \renewcommand{\listtheoremname}{Definitions}     \addcontentsline{toc}{section}{\listtheoremname}     \listoftheorems[ignoreall,show=mydef]      \chapter{Mathematics = Set Theory?}     \setcounter{section}{16}      \section{Set Theory}     \begin{mydef}[Principle of Comprehension]         \label{def:PrincipleofComprehension}         \hfill \break         If $\phi(x)$ is a property or condition pertaining to objects $x$, then there exists a set whose elements are precisely the objects that have the property $\phi(x)$     \end{mydef} \end{document}   This results in:    How can I add some space here, between the number and the text?


It seems Stack Overflow natively does not like any discussion related to third-party software. In Super User, you can ask some specific things about the specific program, but Super User prohibits the following type of questions:  Which software can do such thing? Let me know the lists. The more the better.  Is there a right Stack Exchange site to ask this kind of question? For example: Which software can change color of titlebar in Windows 10? Is there a file explorer that shows size of file as bytes not mega or gigabytes?


Find files with particular filename format, cat each one with a header file, and save result to original file for each such file

I have a bunch of html files and I want to cat them all (individually) with a header file (several lines at least in length), say header.txt. I'm almost there. I can cat each file with the header file with the following command, but how can I then output the result to save it under the original filename?  find . -iname "*.html" | xargs -L 1 cat header.txt    The above prints out what I want, but how can I then reference the xargs argument to add a final > original file name?  So in short, I want to insert the text from header.txt into the beginning of every html file. Can I modify the above command to do so? Or alternately are there other ways to achieve this?    As an update, here's what I've tried since posting, which hasn't worked:  find . -iname "*.html" | xargs -L 1 cat header.txt {} > {}.new   This does fine except it prints to a file literally named {}.new. That file looks as it should but this isn't helpful.  Also tried @Dave's suggestion, but there is a syntax error I can't fix:   find . -iname "*.html" -exec (cat header.txt; cat {}) > {}.new -bash: syntax error near unexpected token `('


Object being squished when using object offset in array modifier

I'm trying to make treads around a tire by applying an Array Modifier and using the Object Offset, but when I select object offset the tire tread it creates is squished in the X axis.  The offset object I am using is an empty plain axes, I've tried offsetting it to other objects and the same thing happened.


I read in a book that ()  160 qubits (quantum bits) could hold $2^{160} \approx1.46\times 10^{48}$ bits while the qubits were involved in computation."  How does this calculation come about? The context of the statement is that a caffine molecule would require $10^{48}$ bits to be represented by a classical computer. However a quantum computer would require 160 qubits and is thus well suited for such representation. If I look at this question on Quora, a 512 bit computer (which I suppose are real) would give a largest 155 digit number (). Isn't that big enough to represent atoms, molecules etc.?


How to remount sdcardfs to allow setting file permisions / ownerships?

I have a rooted OnePlus One running LineageOS 15.1 (Oreo 8.1).  I am trying to adjust some file permissions/ownerships on the emulated sdcard partition. The partition seems to be mounted as an sdcardfs:   A0001:/ # mount | grep /storage/emulated                                                                                /data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)   I'm not sure what that means. Some people suggest that Android used to use mount then switched to fuse and now with Oero uses sdcardfs.  I'm not sure if that makes any sense, but I'm a bit scared that something like mount -o remount, rw /mnt/sdcard/ (which apparently is what you had to do in the past to be able to set file permissions on the emulated sdcard partition).  Short demonstration showing that file permissions won't be applied:  A0001:/ $ su A0001:/ # ls -la /storage/emulated                                                                                total 12 drwx--x--x  4 root sdcard_rw 4096 2018-07-24 17:44 . drwxr-xr-x  4 root root        80 2018-07-24 17:21 .. drwxrwx--x 14 root sdcard_rw 4096 2018-07-24 17:20 0 drwxrwx--x  2 root sdcard_rw 4096 1970-01-01 01:12 obb A0001:/ # touch /storage/emulated/a A0001:/ # ls -la /storage/emulated/a -rw------- 1 root sdcard_rw 0 2018-07-24 17:44 /storage/emulated/a A0001:/ # chmod 777 /storage/emulated/a A0001:/ # ls -la /storage/emulated/a                                                                                -rw------- 1 root sdcard_rw 0 2018-07-24 17:44 /storage/emulated/a   (Note: the same happens if I use /storage/emulated/0 instead of /storage/emulated)  My question is: What do I have to run in order to be able to change the file permissions and file ownerships on this weird sdcardfs partition.


Let $f$ be bounded in $[a,b]$. Assume $f$ satisfies  $$f\left(\frac{x_1 + x_2}{2}\right) \le\frac{f(x_1) + f(x_2)}{2}$$ for all $a\le x_1 \le x_2 \le b $ . Prove that $f$ is continous on $x$ when $a< x < b$.  I'm more concerned with how I can derive the prove of this question


Variable selection with principal components analysis

I ran principal components analysis in R on my data. All my regressors are continuous, non categorical variables, except gender which I excluded. I will add it and compare model 1 = PCA to model 2 = PCA + gender and see if its significant.   I determined that PC1/2/3 determine 95% of the variance so I only consider the first 3 columns. All the variables have non-zero values and come up in the order I inputted it into the matrix of regressors.   I used a spree plot to determine I need 3 regressors to explain most of the variance only (which is rather amazing given I have 30+ variables!).  I am confused how I determine which variables I should choose. Do I order the variables per PC column from highest to lowest and see the variables contributing the most? I saw in the Freeway R guide that they actually plot the graphs and compare - similar graphs they take one variable and different looking graphs they subtract the variables from each other. This was rather confusing to me.   Questions:     Is the ANOVA approach correct in this case for this variable?  Spree plot - do I look for the first 'kink' or the point where the x axis (no of variables) first goes to 0. Mine jumps dramatically down after 3 variables (to about 0.5) and then curves down to 0 on variable 15. Different websites say different things hence I'm confused. Is the approach above correct to write a linear model? Do I write it as $y={\rm variable}_1 + {\rm variable}_2 + {\rm variable}_3$ or do I multiply them or both?


What is the result that that differs by many orders of magnitude between QM and GR?

It is well known that QM and GR are deemed incompatible due to a discrepancy in some calculations which I have read can differ by large magnitudes. What are these calculations to which people are referring i.e. what equations/results?


Let R be a domain with 1. Show that if aR = bR, then au = b for some unit u ∈ R.

Let $R$ be a domain with $1$. Show that if $aR = bR$, then $au = b$ for some unit $u ∈ R$.  Any hint on how to start this proof?


Why didn't Arwen return to the west with Legolas and Gimli?

I listened to the LotR book and appendix, and understood that immortality was tied to the west, though also granted to the elves in Middle Earth (via blessing, was it?) until the end of the third age. If an elf wanted immortality after the third age, they would have to go to the west. Arwen decides to stay in Middle Earth to be with Aragorn and assumes there will be no ship to bear her back to the west. With no way to go back, she eventually dies.  After Aragorn's death, however, Legolas and Gimli go to the west, meaning there still were boats. With no reason to stay, why didn't Arwen go with them? Even if she would die in the west, why didn't she go back to be with her kinsmen instead of staying in Middle Earth, sad and alone?


I use my bicycle in a typical urban commute setting. No extreme MTB, but it still accumulates some dust and grime.  How should I wash my bicycle?


I can't seem to port this line to QGIS 3.0 API     QObject.connect(self.dlg.ui.chkActivate,SIGNAL("stateChanged(int)"),self.toggle_activate)   Any ideas? I believe QObject is deprecated.


When entering the US on VWP, are you required to have proof of onward travel within the 90 days?

I am intend to visit the United States from the United Kingdom for about 80 days under the Visa Waiver Program (I already have an ESTA approved). After this, I intend to fly to Canada to stay for 3-4 months and then return to the UK. I figured that proof of my intent to leave the United States before the 90 days granted by the VWP, and a further ticket from Canada to the UK would be sufficient proof of intent (as well as supporting documents like mortgage statements, bank statements, etc).  However, when going through the steps to book a flight through Kiwi.com, I found the following statement:     A return/onward ticket (or electronic ticket record) must be to a final destination country other than Canada, Mexico or contiguous (adjacent) countries or territories situated in or bordering the Caribbean Sea . If passenger holds proof of residence in, or is transiting the USA to such a country or territory, an onward/return ticket to that country or territory is accepted.   Passenger can make side trips to Canada, Mexico or Caribbean countries/islands, provided first entering the USA on a carrier participating in the VWP. No additional time is given (extension) based on the departure to contiguous (adjacent) territory .   Does this mean I would be required to provide proof of intent to leave the US for the United Kingdom within the 90 days granted by the VWP? Would my ticket from Canada to the UK several months after those 90 days have passed be sufficient evidence to prove my intent to not overstay in the United States? I've read a fair amount on the DoS website, etc. but this is the first time I have read a statement like this.


Can you represent other logical operations using only $\neg$ and $\Leftrightarrow$ (not and equivalence)?

I can check on WolframAlpha for how to represent some logical operations using others, but I don't see anything for $\Leftrightarrow$. Is it because it is impossible?


generate a polygon that only keep its outside boundary

I have 25 different polygons as show in fig. below. These small  polygons can form a bigger polygon without overlaps.     My goal is, according the data of 25 smaller polygons, to generate the bigger polygon that only keep its outside boundary.  Now I have selected the 25 polygons and saveas another file, but the innner lines are also included.   I have tried the layer-property-symbol level method, but there is no such button in my .shp file. I have no idea why.


Just looking for some opinions here before I begin planning my next US trip.  A little background first;   I'm a UK citizen with a clean immigration history. I've made 4 short/medium length visits to the US in during 2011-2012 (on the VWP)  Visited friends in California from 18th June - 12th August 2015.  Visited same friends again from 1st November '15 - 26th January '16.   So as you can see, I spent quite a bit of time in the States last year. I should note that I received no hassle at all after visiting again in November. If anything, it was the most friendly border crossing yet!  I'm about to go through some fun stressful times with moving to a new home. After settling down in my new home for a month or so, I'm considering another vacation in the US to meet with the same friends to unwind and enjoy the California summer for around 3-4 weeks.  I was already feeling nervous about considering a trip in mid-June, considering I will have only been back in the UK for a total of 5 months before flying back out again.  However after stupidly reading a couple of online articles from people who have received hassle from CBP over too many frequent visits, I'm now even more anxious.  So here's my question to you guys. Given my recent travel history, what is your opinion about me possibly travelling again in mid-June?  I would be travelling for a much shorter duration this time, most likely just for 3-4 weeks. Obviously I realise no one can give me a 100% answer since it'll be up to the CBP officer I meet on the day, but I'm still curious to know what you guys think.  Do you think it's too soon? Or am I stressing myself out unnecessarily?   Another point to add is that on both previous visits, I ended up extending my stay by 2-3 weeks more than originally planned. (The last trip extension was due to having a heavy cold, and wanting to fight it off before flying)  Even though both trips were still within the 90 day limit, will the fact I have a history of extending my flights be an issue? (I should note that I'm not intending to do it this time)  I should note that I would be able to bring documentation in regards to my new lease to show ties to the UK, along with evidence of plenty of funds to support my trip, and a return ticket of course.  I should also note that this is the only US trip I am planning for this year.  Thanks in advance for any opinions you guys may have for me!


suppose that $f$ is a mapping from $\mathbb R^n \to \mathbb R$.  a positively homogeneous of degree $n$ and suppose $f_1, f_2, .... f_N$ are continuous for $a \neq 0$. then   $$\sum_{i=1}^n a_if_i(a)= n*f(a)$$   now, they asked me to prove this. (Which is a total no no to me)  I write my proof as;  $f$ is a mapping from $\mathbb R^n \to \mathbb R$  A homogeneous function of degree $n$ if for all $a \in \mathbb R^n$ and all $L>0$, $f(La)=L^n\,f(a)$. let $a \in \mathbb R^n$ and define function $g$ be a mapping from $[0,\infty) \to \mathbb R$. so I write $g(L) = f(La)-L^nf(a)$. then $L≥0$ let $L=0$ then, $g(L)=0$ and therefore $g'(x) =0$?  then i don't know what's goes next. can anyone help me about this?


Comment editing timeout well before "link" is removed

I attempted to edit a comment close to the 5 minute timeout and was denied the opportunity to Save. I cancelled and added a new comment.  While I was watching, the edit link of the previous comment didn't go away until it said I edited it 7 minutes ago.  IMHO the edit link could go when it says edited 5 minutes ago, or at least by the time it says 6 minutes ago.  I've changed this to a feature-request because the test comment I added to this question still shows the edit link 10 minutes after I added it. Clearly the link is not currently removed until a page refresh.


Can an area of effect spell cause damage to the same target multiple times a round?

Yesterday, I  regarding the spell Sickening Radiance. The most upvoted answer satisfied the question, but it also added this small line:  Yes, forcefully moving enemies into the area does cause them to be affected by the spell. Note, however, that in that case they would not also be affected on their turn. Sorry, no 8d10 damage per round here...  I don't see anything that would make this the case, yet it is upvoted (as of writing) five times, hence this question. Sickening Radiance states:  When a creature moves into the spell's area for the first time on a turn or starts its turn there, that creature must succeed on a Constitution saving throw or take 4d10 radiant damage [...]  As far as my understanding goes, a turn and a round are two explicitly defined different things by the PHB:  The game organizes the chaos of combat into a cycle of rounds and turns. A round represents about 6 seconds in the game world. During a round, each participant in a battle takes a turn. (PHB, 189)  So, to give an exact example, let's say an enemy is pushed into Sickening Radiance and is affected by the spell ("moves into the spell's area of the first time on a turn"). If during the same round, the enemy's turn starts inside of it ("or starts its turn there"), are they affected again?


Calculating wetland coverage/overlay over parcels of land?

I have two layers. Layer 1 has features that are property/parcels with area in acres. Layer 2 has features that are wetlands/bodies of water with area in acres.   I want to calculate the percentage of wetland coverage on each individual property/parcel.   How can I do this on ArcGIS Desktop?  Ideally, I want to find parcels/properties that have a limited number or a limited percentage of wetland coverage.  These are the shapefiles that I have (see attached image):   Carson Parcels (Yellow) Wetlands (Blue)   People have recommended that I use the Tabulate Intersection tool. I have attempted this but have not been successful.   I am new to ArcGIS.


Why do enumerated lists become more compact when using `columns` with `parskip` loaded (beamer)?

When I use columns environment to include enumerate items, the presence of parskip will force enumerated items to become more compact.    The output above will not be the same if parskip is disabled.  My MWE  \documentclass[aspectratio=169, xcolor={x11names}]{beamer}   \usecolortheme{rose}      \setbeamercolor{itemize item}{fg=black}  \useoutertheme[]{split}  \useinnertheme{inmargin}      \setbeamersize{text margin left=2mm, text margin right=2mm}      \newlength{\sidebarWidth}     \setlength{\sidebarWidth}{0.2\paperwidth}      \setbeamersize{sidebar width left=\sidebarWidth, sidebar width right=0cm}  \usefonttheme{structurebold}    \usepackage{parskip}  \usepackage{fvextra} \let \verb \Verb    \begin{document}  \begin{frame}      This is an example of \verb{columns} environment used to include a side figure      \begin{columns}          \column[t]{0.5\textwidth}              \begin{itemize}                 \item Item                 \item Item                 \item Item             \end{itemize}          \column[t]{0.5\textwidth}              \includegraphics[width=\textwidth]{example-image-a}      \end{columns}      \begin{itemize}         \item Item         \item Item         \item Item     \end{itemize}  \end{frame}  \end{document}


Problems with the standalone class when using certain environments and certain math symbols

I use TeX Live 2015.  Update. I just found out that using the preview option to the class solves the problem, yet only crops the content vertically, not horizontally.  I want to use a grammar environment from the syntax package within a standalone documentclass (for producing small images). But when I run pdflatex on  \documentclass{standalone} \usepackage{syntax} \begin{document} \begin{grammar} <A> ::= `Z' \end{grammar} \end{document}   I get the following errors:  ! LaTeX Error: Something's wrong--perhaps a missing \item.  See the LaTeX manual or LaTeX Companion for explanation. Type  H <return>  for immediate help.  ...                                                l.6 \end{grammar} ?   ! LaTeX Error: Something's wrong--perhaps a missing \item.  See the LaTeX manual or LaTeX Companion for explanation. Type  H <return>  for immediate help.  ...                                                l.6 \end{grammar} ?    Of course, I can skip through them, but then my output becomes  .  When I run the same code with the standalone class replaced by minimal, I get – without any errors – the expected output, viz:    So I have two issues:   How can I get the standalone class to work with the grammar environment? How can I get the standalone class to correctly compile certain symbols like ‘<’ and ‘>’?   By the way. I realise I am misusing the standalone class. My use case is: Create small pictures out of latex code to include them on a website (where I don’t want to use MathJax). If you know of a good way to accomplish that, I’d be happy to give that a try instead.


Community Wiki edit history showing outdated username

I have an answer I gave on a question here:   The referenced username that has the majority of edits references one of my different aliases I had used at the time. But it has not updated to reflect my current username, contraband bandicoot?  Is this an intended feature?


Could you help me please with some functional equations? I need some online books with exercises and some explanations. I'm interested in the Cauchy functional equation and Jensen functional equation.


I looked at the nginx documentation and it still confuses me utterly.  How does try_files work? Here is what the documentation says:       try_files      syntax: try_files path1 [path2] uri      default: none      context: server, location      availability: 0.7.27      Checks for the existence of files in order, and returns the first file   that is found. A trailing slash indicates a directory - $uri /. In the   event that no file is found, an internal redirect to the last   parameter is invoked. The last parameter is the fallback URI and   must exist, or else an internal error will be raised. Unlike rewrite, $args are not automatically preserved if the fallback is not   a named location. If you need args preserved, you must do so   explicitly:   I don't understand how it checks the paths and what if I don't want an internal error but have it resume the rest of the path in an effort to find another file?  If I want to try a cached file at /path/app/cache/url/index.html and if it fails to try /path/app/index.php how would I write that? If I wrote:  try_files /path/app/cache/ $uri include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket; fastcgi_param SCRIPT_FILENAME $document_root/index.php;   I have index index.php index.html index.htm;. When I visit /urlname, will it try checking /path/app/cache/urlname/index.php then /path/app/cache/urlname/index.html? If we ignore everything after try_files is it possible for try_files to check the cache folder? I have been trying and have failed.


At the moment I try to learn more about java and try to code a graph.  I have a HashMap with . At the moment I want to implement a DFS but it won't work.   I want to add all nodes who are achievable from the startNode to a List  Is the code in principle correct or ok? I get a NullPointerException if I test my program. But I don't know why. I know a NPE is but in my mind my code shouldn't throw a NPE. So please don't mark it as duplicate from a NullPointer Question.  Thank you a lot for helping!  Here is my code:   /**  * For a given node the method returns all nodes the outgoing edges of the node directly lead to.  *   * @return list containing all directly connected nodes.  */ @Override public List<Node> getAdjacentNodes(Node startnode) {     List<Node> nodes = null;     if (startnode != null && this.nodes.values().contains(startnode)) {         return startnode.getAdjacentNodes();     }     nodes = new LinkedList<Node>();     return nodes; }  @Override public List<Node> getAdjacentNodes(int startnode) {     return getAdjacentNodes(nodes.get(startnode)); }public List<Node> depthFirstSearch(Node startNode){     LinkedList<Node> nodeList = null;     resetState();      //Get a List with all Adjacent Nodes from the startNode     List<Node> node = getAdjacentNodes(startNode);     //Test for each of the ADjacent Nodes from startNode if the current status is white     for(Node child : node) {          //Is the status white, run the recursive method         if(child.status == Node.WHITE) {             runDFS(child);         }      }      return nodeList; }  public LinkedList<Node> runDFS(Node child) {     //Create a LinkedList as in the depthFirstSearch-Method     LinkedList<Node> nodeList = null;     //Set the status from the current child to GRAY     child.status = Node.GRAY;     //For each Child from the AdjacentsNodes from the child check if color is white     for(Node nextNode : getAdjacentNodes(child)) {         if (hasWhiteNeighbor(nextNode) == true) {             //is color white execute the runDFS method again to get to the last node             runDFS(nextNode);         }         //If the color is not white set it to black and add the node to List, because last node was found         else {             child.status = Node.BLACK;             nodeList.add(child);         }     }     return nodeList; }


Why don't lens manufacters just label their lenses in 35mm equivalent terms?

I recently read a question asking if a 35mm DX lens on a APS-C body would produce a 35mm picture. There was a good bit of discussion / corrections regarding the crop factor vs field of view terminology being used.  Maybe a revised question that many of us may wonder is if we're trying to buy a DX lens for a DX camera body then why doesn't Nikon artificially alter the field of view so it matches the field of view on a full frame camera / lens combo? So maybe its actually a 22mm DX lens on a DX body but says 35mm on the lens to accurately describe the field of view?   That way consumers could buy the lens they really want without worrying about the math and not confuse people. You have to keep in mind that most of the people buying camera combos are not pros and do photography for a living.


Add a selection of default tags to all metas

Suppose a new user has a question to ask on a new meta site about badges. The meta site is too new to have a badges tag and the user is too new to have enough rep to create tags.  It would be useful if all of the per-site metas had a selection of generic tags from the start. As well as allowing low-rep users to use common meta tags, it would also make it easier for someone wanting to retrieve data on multiple meta sites from the data dump, as tags meaning the same things would have the same names across multiple sites.


I recently started java programming.  I'm getting java.lang.NullPointerException in my serlvet. Code is posted below. can anyone help me please?   I'm using mysql- username, password,  etc are correct.I can see the values in table.  message in console -  java.lang.NullPointerException  at j2ee.Authenticate.processRequest(Authenticate.java:49)  at j2ee.Authenticate.doGet(Authenticate.java:93)  Code -  package j2ee;   import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;   @WebServlet(name = "Authenticate", urlPatterns = {"/Authenticate"}) public class Authenticate extends HttpServlet {   protected void processRequest(HttpServletRequest request, HttpServletResponse response)         throws ServletException, IOException {     response.setContentType("text/html;charset=UTF-8");     PrintWriter out = response.getWriter();      String user = request.getParameter("userId");     String pwd = request.getParameter("passwd");     String dbuser = null;     String dbpwd = null;      try {     Class.forName("com.mysql.jdbc.Driver");     Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/j2ee","root","password");      String query = "select username, password from user_info where username=? && password=?";       PreparedStatement p = con.prepareStatement(query);      p.setString(1,dbuser);        p.setString(2,dbpwd);         ResultSet rs=p.executeQuery();           if(dbuser.equals(user) && dbpwd.equals(pwd))     {             String s=request.getParameter(user);             out.println("Welcome" +s);              RequestDispatcher rd = request.getRequestDispatcher("Home");             rd.include(request, response);      }        else     {             out.println("Please enter a valid Username and Password!");              RequestDispatcher rd = request.getRequestDispatcher("Login");             rd.include(request, response);      }  }     catch (IOException e)     {     System.out.println(e);     } catch (ClassNotFoundException e) {         System.out.println(e);     } catch (SQLException e) {         System.out.println(e);     } catch (ServletException e) {         System.out.println(e);     }   }


Is dimensionality reduction almost always useful for classification?

Is singular value decomposition almost always useful in practice for enhancing the predicative power of a trained classification model?   E.x. A dataset for classification has 20,000 features. Run SVD to convert them to top principal components and transform them to 300 features, and trained a classification model. When predict the class of a test instance, convert it to a 300d principal component feature vector, and use the trained model to predict its class.  Are there some notable real datasets of numerous features (variables) in which dimension reduction by SVD would hurt the predictive power of trained classification models?


I'm working on a jet in blender. While thinking about the final scene, I wondered if there was a way to create schock diamonds(also known as Mach diamonds, Mach disks, Mach rings, donut tails or thrust diamonds) in blender.  Hopefully somebody can help, I haven't found anything online.      picture from wikipedia  picture from Tom Clancy's H.A.W.X  thanks for any tips.  tags: mach, schock, diamond, jet, exhaust, afterburner, engine, Physical phenomena  edit: added some pictures,


This  inserts a tag to the beginning of a file:  sed -i "1s/^/<?php /" file   How can I insert something to the end of each file with sed?


Displaying and/or searching across thousands of contacts?

The Need  Our application has a chat feature that allows our users to chat with other users within their database.   However, we're adding a feature that allows clients to share data between multiple databases as an "Enterprise" configuration, and we've been asked to update the design of the chat feature to allow users to chat with other users within any of those databases.   We've looked at the numbers of possible users in these scenarios, and the number of chat users in these shared database environments can be as many as 5,000.   Users need to be able find people they need to chat with out of these thousands of contacts. However, up til now, we've had a list of contacts the users can browse. Since that is a user expectation, we were hoping to still maintain a browse-able list of contacts. We have ruled out trying to display a list of 5,000 contacts, as this doesn't seem to be anywhere close to useful or usable.   We've come up with three approaches to solve the problem:  Option One  Show a list of contacts from the local database that user's can browse. Have a second tab that allows users to search the "Full Directory", returning results from multiple databases.     Pros:   Allows us to show a browse-able list of relevant contacts  Clearly indicates to users that another source of chat contacts are available   Cons:   Search would be limited to the current tab, meaning users would have to be in the right tab to return the right result Adds a possible source of user confusion: whats the difference between "contacts" and the "full directory"? Adds another tab to what should be a simple chat list     Option Two  Show a list of contacts from the user's local database, but if they search for a contact, include results from other databases as well.     Pros:   Maintains a list of contacts the user can browse Avoids adding adding another tab One search field searches all sources   Cons:   Searching a finite contact list and returning results that weren't in the contact list may defy user's mental model of how the search will work. Not clear that another source of contacts exist. May need to add explanatory text that says "Search to see contacts from the full directory".      Option Three  Add a dropdown that allows a user to select a what to search in: the local database, or the full directory.     Pros:    No additional tab required Indicates to users that another source of chat contacts are available, though not as clearly as option 1   Cons:    Search still isn't universal: the right search category must be selected to return the right result Users may not notice the dropdown or understand intuitively what its function is. May require explanatory text in search results, reminding the user they can expand the search to the full directory     Thoughts?  Right now I'm leaning towards option two, but is there another option I'm not considering here? Is there another alternative worth considering?   Thanks!


What is the difference between a correlation coefficient and a regression coefficient?

From my understanding the correlation coefficient is r (the correlation between two variables) and ranges from -1,1 to tell the strength of a linear relationship. and is estimated as: $$r_{xy}=\frac{COV_{xy}}{\sigma_x\sigma_y}$$  The regression coefficient is simply the beta in a regression analysis. It tells the strength of the relationship. and is calculated through finding the slope of the line.   So...how is the covariance related to the regression coefficient?


Alternative tool to Photoshop that allows editing PSD files with "smart objects"?

Are there any other tools than Adobe Photoshop available that allow to edit PSD files that contain smart objects? (I checked GIMP but it doesn't support smart objects)


Random forest: Out of bag error increases with number of treees

I am running a random forest on a binary classification variable using about 30 explanatory variables. Please have a look at the screenshot below. You see that the out-of-bag errors for class 2 increases as the number of trees increases. This looks weird, as I expect the out of bag error to decrease as more trees are added.  Can somebody explain this or point me in the right direction?


I've just learned of a local century ride that is only 2 weeks away. I'd like to join, but not sure if I'm ready. I've been commuting by bike for the last five years. The last year of my commuting has been 18 miles/day that I do at least 4 days/week. Over the last 2 months, I've done several weekend rides of 40-50 miles, but I haven't gone over 50. I usually take one 10-minute break at about the 75% mark during these longer rides. After these longer rides, I'm tired and hungry, but feel like I could keep going at a leisurely pace after eating. Am I ready to leap to 100 miles? I don't have any days between now and the event where I'll be able to go for more than about a 30-mile ride.  The terrain for the century is flat, just like my normal biking.


Sylow $p$-subgroup of a direct product is product of Sylow $p$-subgroups of factors

Let $G = H \times K$ be a finite group (direct product), $P$ a Sylow $p$-subgroup of $G$. Prove that there exist Sylow $p$-subgroups $H'$, $K'$ of $H$ and $K$ respectively so that $P$ = $H' \times K'$   I am very new to the group theory, so can you explain solution properly? Thank you for your help.


My wheezy server has apt sources set as below  deb http://security.debian.org/ wheezy/updates main contrib non-free deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free  Are all security updates also available through regular wheezy-updates?


What is there behind the door in Portal 2's "The Surprise" chamber?

Assuming you didn't die, by cheating or whatever, is there anything interesting after that door?


Showing $\gcd(a,b,c) = \gcd(a,\gcd(b,c))$ without using Bezout's lemma and only the definition of the gcd

Let $a,b,c \in \mathbb{Z}$ where $(b,c)  \neq (0,0)$. I would like to show that $$ \gcd(a,b,c) = \gcd(a,\gcd(b,c)). $$ The definition of the greatest common divisor (gcd) we received in our class is $$ \gcd(a_1,\dots,a_n) = \max\{ m \in \mathbb{N} \, | m \, | \, a_i \text{ for all }i=1,\dots,n \}. $$ Now I was able to show that $\gcd(a,b,c) \geq \gcd(a,\gcd(b,c))$, so only the $\leq$-part is missing. I tried to solve it myself but could not do it, so I looked up for answers online (). It seems that the crucial part is to show that $$ g \, | \, b,c \quad \Longrightarrow \quad g \, | \, \gcd(b,c) $$ However, all proofs I found for this use either Bezout's Identity or the least common multiple which we did not cover in our class yet. But now I still don't know how to solve my homework otherwise and find a short proof which only uses the definition of the gcd I wrote above. Could you please help me here?


A club consisting of 6 men and 9 women will choose a committee of 4. In how many ways can the committee be chosen if it must contain at least 1 man?  I started out this problem like this:  men   C(6,1)        =6  women   C(9,3)          =84   But then I realized that it was exactly the same as my problem before this one. The one before said it must contain exactly 1 man which I double checked my answer on here and it was correct. Now this question is asking for it to contain at least 1 man, so now I'm confused on how to solve it.


Recommended shutter speed for action sports?

What shutter speed do professional sports photographers typically use for action sports like football and basketball?


JTextField ActionListner won't change RGB Variable

Im trying to create a program that allows me to change the the variables R,G,B in the Text class. Whenever I try to run the Applet, by clicking the "SubmitR" Button, it gives me a Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException.   public class Main extends JApplet { private ButtonHandlerR buttonHandlerR;     @Override public void start() {     super.start(); }   @Override public void init() {       this.setSize(750, 300);      setLayout(new BorderLayout());      add(new SetTextColour(), BorderLayout.NORTH);     add(new Text(),BorderLayout.CENTER);       }   }  public class SetTextColour extends JPanel {   private JLabel labelR; private JLabel labelG; private JLabel labelB;  public JTextField textR; public JTextField textG; public JTextField textB;  public JButton submitR; public JButton submitG; public JButton submitB;   public SetTextColour() {      labelR = new JLabel("RED: ");     labelG = new JLabel("GREEN: ");     labelB = new JLabel("BLUE: ");      textR = new JTextField(10);     textB = new JTextField(10);     textG = new JTextField(10);       add(textR, BorderLayout.NORTH);     submitR = new JButton("SubmitR");     add(submitR, BorderLayout.NORTH);      add(textB, BorderLayout.NORTH);      submitG = new JButton("SubmitG");     add(submitG, BorderLayout.NORTH);      add(textG, BorderLayout.NORTH);      submitB = new JButton("SubmitB");     add(submitB, BorderLayout.NORTH);      ButtonHandlerB BHB = new ButtonHandlerB();     ButtonHandlerG BHG = new ButtonHandlerG();     ButtonHandlerR BHR = new ButtonHandlerR(this);      submitB.addActionListener(BHB);     submitR.addActionListener(BHR);     submitG.addActionListener(BHG);   }   }  public class ButtonHandlerR implements ActionListener { private SetTextColour colour; private Text text;   ButtonHandlerR(Text change){     this.text = change;  }  ButtonHandlerR(SetTextColour set){     this.colour = set;  }       @Override public void actionPerformed(ActionEvent e) {      JButton Clicked = (JButton) e.getSource();     double tempV;     int tempV2;      if(colour.submitR == Clicked){         tempV = Double.parseDouble(colour.textR.getText());         tempV2 = (int) tempV;         text.R = tempV2;         System.out.println(text.R);         text.repaint();       }    }   }  public class Text extends JApplet { private String textField = "Welcome to CE203 Assignment 1 - Hassan Khan, 1404460";  public int R=50;  private int G=32;  private int B=54;  public void start(){  }      public void init(){     }  public void paint (Graphics g) {       Color customColor = new Color(R, G, B);      g.setColor(customColor);      g.drawString(textField, 125, 150);    }   }


Just installed synaptic and was sent back the following message when i attempted to open it

E: Malformed line 1 in source list /etc/apt/sources.list.d/spotify.list (dist parse) E: The list of sources could not be read. Go to the repository dialog to correct the problem. E: _cache->open() failed, please report.  Help?


From Quantum Mechanics to Classical Mechanics

Is it possible, and has it been attempted, to use quantum mechanics to deduce Newtonian, macroscopic level mechanics laws as was the case of statistical mechanics deriving thermodynamic relations?


I've played some fallout with an average all-rounder character to get to know the game and see which play-style I like. Now I would like to specialize, but I don't really have much desire/spare time to redo all the story that I've completed so far starting with a new character, so I'd like to respec. Effectively, I would like to reallocate SPECIALs and perks picked for level-ups.  Note, I'm fine with cheating this, if its the only option.


Mac OS X Yosemite: It is possible to disable the animation when switching "spaces"?

Is it possible to disable the animation when switching "spaces"?  The animation is jarring, and isn't really usable if used in high repetition.  Note: this question is specifically for OS X Yosemite


I have tried to upgrade 18.04 to 19.10 using command lines but there is one issue it's showing me is that:  Please install all available updates for your release before upgrading.   I have also tried for updates and it's showing it's up to date, now what I can do for upgrade my 18.04 Ubuntu to 19.10?


How are the scores calculated in Winter Bash's "Hat-Dash"?

I recently noticed that in Winter Bash the scores are not proportional to time played and sometimes I scored more in less time.  In this image you can clearly see the difference in scores and time taken. So how exactly are the scores calculated in Winter Bash Hat-Dash? Also, does something like this also happen in other games like Chrome's "Dino Runner"?


Excel Pivot table only counting first column

The Issue  I'm trying to count instances of a number in each column. For a simgle column of data, this works fine, but when I add more columns, the count always reflects the first column.  Attached is a minimal example of the issue I'm facing:    What I Am Doing   I am selecting the entire data set (which in reality is much bigger) and inserting a pivot table.  I am not ticking the box labelled Add this data to the Data Model in the dialog that pops up. in the PivotTable Fields pane on the right I am adding my columns of data to the VALUES quadrant and selecting Count of <A/B...>.  In the column quadrant a field named VALUES automatically appears. I add one of the columns to the ROWS quadrant. I then go on to group the rows (not shown in this minimal example)   What I Have Tried   Adding both column FIELDS to the ROWS quadrant of the PivotTable Fields pane on the right, but this creates a strange nested "Row Lables" column. Adding a seperate column for the values to be counted. Count Of Numbers instead of Count Various tutorials on how to correctly achieve this for a single column, in case I was doing it wrong.  appears to do what I want, but I don't seem to have access to PowerQuery.   Update  After looking at  I now have .  Clearly this is much closer to what I want (and I can turn off the grand totals in the pivot table's settings easily enough) but it is now bizarrely ignoring the first column. (A blank column to the left of the range fixes it, but I have no idea why...)


Why is my program not recognizing the comparison between two strings in an if statement?

Here is my code (question listed below):     import java.util.Scanner;  public class ExampleCode {  /**  * B. Stephens  */ public static void main(String[] args) {      Scanner input = new Scanner (System.in);      String secretPhrase = "show me the money";     boolean notDone = true;      while (notDone = true){         System.out.print("Guess the puzzle: ");         String puzzleGuess = input.nextLine();         if (puzzleGuess == secretPhrase) {             System.out.println("Congratulations! You guessed the puzzle!");             notDone = false;         }     }  } // end main   For some reason, the program isn't recognizing when my input (puzzleGuess) is the same as secretPhrase.  It seems like there is no reason the correct input shouldn't end the program.  Thanks for any help!


I cannot figure out why lines are not being showed on the shaded columns. Can I get a little help finding what is wrong?     EDIT: The MWE follows:  \documentclass[12pt, a4paper]{article} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage {setspace} \doublespacing  \usepackage{fullpage} \usepackage{graphicx, pdflscape} \usepackage{tikz} \usepackage{colortbl}    %for shading* \usepackage{pifont}    %for pointing hand \usepackage{arydshln}    %for dashed lines \begin{document}  \begin{center} \renewcommand*\arraystretch{1.2} \scalebox{1}[1]{\begin{tabular}[t]{|rrl||c|c|c|} \hline  \multicolumn{3}{|c||}{kesaks} & CF & CS & F \\[0.5ex] \hline \hline a. & \ding{43} & kesaks & $\ast$$\ast$ & \cellcolor{lightgray} & \cellcolor{lightgray} \\ \hline b. & & gesaks & $\ast$$\ast$$\ast$! & \cellcolor{lightgray}$\ast$ & \cellcolor{lightgray}$\ast$ \\ \hline c. & & gezaks & $\ast$$\ast$$\ast$!$\ast$ & \cellcolor{lightgray}$\ast$$\ast$ & \cellcolor{lightgray}$\ast$$\ast$ \\ \hline d. & & gezags & $\ast$$\ast$$\ast$!$\ast$$\ast$ & \cellcolor{lightgray}$\ast$$\ast$ & \cellcolor{lightgray}$\ast$$\ast$$\ast$ \\ \hline  e. & & gezagz & $\ast$$\ast$$\ast$!$\ast$$\ast$$\ast$ & \cellcolor{lightgray} & \cellcolor{lightgray}$\ast$$\ast$$\ast$$\ast$$\ast$ \\ \hline \end{tabular}} \renewcommand*\arraystretch{1} \end{center}  \end{document}


i have installed wordpress in a sub-folder but whenever i click on a page link in sub-folder then it redirects to a page that is in root folder. the root folder also have a wordpress site.   what i want to stop redirect to root folder and access the page in sub-folder.  Note whenever i hover on the menu(page) link it show the real page URL but when i click then it redirects me to root folder that has a same page.  i know that there is some issue in the .htaccess file but unable to find exact solution as i have searched   and  and a lot more  but found nothing. i am totaly stuck with this issue.


Charging a mobile Tablet while communicating with a USB device at the same time

I have designed a product (small spectrometer) using FT234XD usb-to-uart bridge and it connects to any mobile phone via USB cable (90mA maximum current). My device acts as USB slave and can connect to any mobile phone which supports OTG. However, we are facing one problem. We are selling our product with lenovo tablet and user won't be able to disconnect the device and charge the tablet regularly.  I came across several links stating that most of the usb hardware in mobile phones and tablets have a mode in which mobile/tablet can act as USB master and still charge itself at the same time. So, we have tried several resistors across ID pin and ground of the usb connector but tablet either charge only or it detects the device.   Finally, I am considering one FT311D chips which may work for us but I am not sure if it will be possible with it. Can anyone help me with this problem? Should we try other things with existing hardware (FT234XD) or try this new FT311D chip?   EDIT:  My Tablet is Lenovo Tab 3 Essential Tablet. I am planning to try FT312D. Good news is that my team ran few software tests and get to know  Tab software supports Android usb accessory mode. In this mode, FT312D will be the host and I think I can charge the tab and communicate with it.  I think It will work because tab will be in slave mode and can charge itself while communicating with my device and only thing required support of accessory mode in software. Am I correct?  EDIT 2  My device has PIC24E 16-Bit microcontroller. There is no USB Protocol specific firmware in PIC24EP. PIC24EP just communicates with mobile application using string based commands. PIC sends commands over UART and FT234XD converts them to USB. Commands received from Android application is converted to commands over UART and is returned to PIC. So, I think changing USB part of my device doesn't require any change in firmware of my primary microcontroller.


Open-source parser code for Mediawiki markup

I'm interested in selectively parsing Mediawiki XML markup to generate a customized HTML page that's some subset of the HTML produced by the actual PHP Mediawiki render engine.  I want it for BzReader, an offline Mediawiki compressed dump reader written in C#.  So a C# parser would be ideal, but any good code would help.  Of course, if no one has done it before, I guess it's time to start a project maintaining a free and separate Mediawiki parser, based on Mediawiki's own parser, but less tightly integrated with Mediawiki itself.  So, does anyone know of any base I could begin with, that would be better than hacking from the Mediawiki PHP code?


I need to ask a user to request either a minimum or maximum value. What would be the appropriate label for this? I have considered extremum but I am not sure if this is commonly understood or appropriate.  Example: Is the user interested in a companies lowest or highest stock price over the last 6 months? They will have the option of choosing 'min' or 'max'.


I am using ArcGIS Desktop to view one shapefile.   Only a select number of features are being displayed. The same number are showing in the attribute table even though the database file (.dbf) has a complete list with many more features.   I then tried opening the shapefile in QGIS and it informs me that the file is invalid. Upon inspection of the shapefile, I found that the .shx file is missing.  Can I recreate the missing .shx file so that all the attributes/features can be loaded?


difference between sources.list and sources.list.distUpgrade

On ubuntu, in the /etc/apt/, there are two files: sources.list and sources.list.distUpgrade. But I only know they are used to update system. However, what are the the difference between them? by the way, what the GPG keys used for? when I update the sources.list using ubuntu source list generator, should I update GPG keys as well?   Thanks !


!#/usr/bin/perl -w   use strict;   use warnings;   use File::Find::Rule;   my $finder=File::Find::Rule->directory->in($directory);     Warning is  Can't locate File/Find/Rule.pm in @INC   (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./test.pl line 4.   BEGIN failed--compilation aborted at ./test.pl line 4.


I'd like to implement icons like those in the figure below to denote, for instance, the level of satisfaction of a certain requirement.    I didn't find such icons in any icon pack. I also tried \mathrel but the circles are not perfectly concentric at the end. How can i solve?  Moreover, is there a way to create them deciding the ratio between the black circle and the white one?  Thank you in advance.


Among 10 sites that I open them daily, Stackoverflow is the fastest one, How you made that?

I knew this question might be more technical, but amazing to know at least some background information about hosting model and how a dynamic site with millions of users can be navigated very fast...  Also, with slow Internet Line, I can always navigate SO without any problem :)   Can you please explain how you made that?


Algorithm in beamer class gives slew of errors, starting with outer par

Here is the minimum example: \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage{algpseudocode,algorithm,algorithmicx}  \begin{document}  \begin{frame}[fragile]{Sequential algorithm}  \begin{algorithm}   \begin{algorithmic}[1]     \If{Timeo daneos}         \Let{et dona ferentes}     \endif   \end{algorithmic} \end{algorithm}  \end{frame}  \end{document}  It gives 8 errors, starting with an outer par error, which I do not understand as there is no box. Also some missing numbers and undefined control sequences that don't make sense to me.


Merging two line equations having similar angle into a new one

I would like to merge two lines having a y = mx + b equation with very close angles. I am simply comparing their angle difference, then I create a new line passing through the middle of these by calculating their m and b average.  This method succeeds when the algorithm encounters two lines with positive values.    The segment on the right has it's m variable set to 0.034, and b variable set to 109.49. The segment on the left has it's m variable set to 0.017, and b variable set to 128.72.  The averaging method gives a result of m being 0.026 and b with the value of 119.105.  But I am actually stuck in the case where there are two diagonal lines, where one of them has a negative m variable.    The segment on the top right has it's m variable set to 26.837, and b variable set to -44172.254. The segment on the bottom left has it's m variable set to -19.648, and b variable set to 29264.59.  The averaging method gives a result of m being 3.5945 and b with the value of -7453.8324.  Is there a more efficient method of solving this problem ?


Calculate Integral using residue theorem

I want to verify the following result using the residue theorem:     $$\int_0^\infty \frac{\log(x)}{x^2+a^2}dx = \frac{\pi}{2a}\log a, \, a > 0.$$   Here are my ideas:    At first I might want to show that this function is in fact a well defined improper Riemann integral, but I didn't come up with any nice solution yet.    I want to integrate the function $f(z) := \frac{\log(z)}{z^2+a^2}$ along the contour $C:= \gamma_1 \cup \gamma_2 \cup \gamma_3 \cup \gamma_4$ constisting of to semicircles with center at 0 around the upper half plane and radius $R$ and $\epsilon$ (resp.) as well as the intervals $[-R, -\epsilon]$ and $[\epsilon, R]$.    For the complex logarithm, use the branch $\log z = \log|z| + i\theta, \theta \in [-\pi/2, 3\pi/2)$ so we don't get any problems on the real line (is this choice correct?).  Note that I have one pole in my contour, namely $z = ia$. The Residue theorem yields $$\int_C f(z) dz= 2\pi i \text{ Res}(f, ia) = 2\pi i\lim_{z\to ia}(z-ia) \frac{\log z}{(z-ia)(z+ia)} = 2\pi i\frac{\log(ia)}{2ia} = \pi \frac{\log(a)+ i\pi/2}{a}$$ Proceeding, we choose the following parametrizations: $$\gamma_1 : [-R,0]  \to \mathbb C, \quad t\mapsto -\frac{\epsilon t}{R} + (t-\epsilon) \\ \gamma_2 : [0, R] \to \mathbb C, \quad t\mapsto -\frac{\epsilon t}{R} + (\epsilon+t) \\ \gamma_3: [0, \pi]\to \mathbb C, \quad t\mapsto \epsilon e^{it} \\ \gamma_4:[0,\pi] \to \mathbb C, \quad t \mapsto Re^{it}$$ Now here's what I am unsure about. To show that the big and the small circle vanish as $R\to \infty$ and $\epsilon \to 0$ is not too hard, but how to deal with the other integrals? Can I just say  $$\int_{\gamma_1} f(z)dz = \int_0^R \frac{\log(-\frac{\epsilon}{R}t+\epsilon+t)}{(-\frac{\epsilon}{R}t + \epsilon + t)^2 + a^2}(\frac{\epsilon}{R}+1)dt \xrightarrow{\epsilon \to 0} \int_0^R \frac{\log t}{t^2 + a^2}dt$$  or what kind of reasoning should be used to interchange limit and integral?Also, I then finally I get $$\int_0^\infty \frac{\log(x)}{x^2+a^2}dx = \pi \frac{\log a + i\frac{\pi}{2}}{2a}$$ almost what I want, but where does $i\pi /2$ come from?  Thanks in advance!


How to put label text in two rows using QGIS?

I have a long text in one attribute field and want to place it as a label. Because the text is so long I want to divide it in two rows. How to do that using QGIS. I have a solution to divide text in two fields and make multi labeling, but I don't want that.


I have implemented working template class LList< T> and now I want object of this template class to be a property of a new class called Factory2. Here is how my Factory2 class looks like   #include "LList.h" template<typename T> class Factory2 { public:     Factory2();    ~Factory2(); private:     LList<T> arr;  };   I have defined the  constructor and destructor of Factory2 but how should I implement them for the LList< T> arr object? The LList< T> class has it's own constructor and destructor. I get the error:undefined reference to the constructor of LList<int>::LList() and LList<int>::~LList()


I'm currently developing a device which require an ethernet switch on it (to provide Internet connection to a microprocessor and an iPad). One of the major goal is to make it very small.  I found an ethernet switch IC and a USB to Ethernet IC (both have MAC and PHY integrated), but I was wondering if it's necessary to put a magnetics between both of them or I just do some direct connection. Maybe an alternative with smallest passive component would be possible?  My microprocessor has an ethernet port on it, so I guess it would be the same connection as the USB to Ethernet IC?  Thank you all.


i'm code beginner #include <bits/stdc++.h> using namespace std;  void init(int* arr){     arr = new int[10];     cout << arr << endl; }  int main(int argc, char* argv[]){     int *arr;     init(arr);     cout << arr << endl; }  this is a simple code. My question is that why arr's address in init function and arr's address in main function is different? My think is that i gave arr's address to init function and in init function, arr is assigned a new address through 'new int[10]' So, arr's address in init function and in main will be same. but this code doesn't work as i think..... Can you tell me why?


How can I save flour from little insects?

Red and white little insects appeared in the flour.Are these harmful for flour? How can I save flour from those?


How to align the long state in algorithmicx

I want to reedit the algorithm in the paper. But the statement can not stay in the right place when I have a long state in algorithmicx.  I want it aligned as the paper does. Is there any simple solution?  My code is  \documentclass{IEEEtran} \usepackage{algorithm}  \usepackage{algpseudocode}    \begin{document}  \begin{algorithm}     \caption{Funcation scaleUpResources()}      \begin{algorithmic}[1]         \State Select a kind of $newVm$ satisfying the $r_{new}\left(t_{i}\right)+t s_{i} / P_{new}+delay<d_{i}$;         \State Sort $H_a$ in a decreasing order by the remaining MIPS;         \For {$h_k$ in $H_a$}             \If {$h_k$ can accommodate $newVm$}                 \State create $newVm$ on $h_k$;                 \State return $newVm$             \EndIf         \EndFor         \For {$h_s$ in $H_s$}             \State{                 Migrate the VM with minimal MIPS to other hosts with the fault-tolerant requirements: 1. The primary and the backup of one task can not allocate on the same host 2. $t_i^P$ and $t_j^P$ can not  on the same host if $t_i^B$ and $t_j^B$ overlap.             }              \If{$h_s$ can accommodate $newVm$}                 \State Create $newVm$ on $h_s$;                 \State return $newVm$             \EndIf         \EndFor         \State Turn on a host on $h_new$ in $H_s$;         \If{the MIPS of $h_{new}$ satisfies $newVm$}             \State Create $newVm$ on $h_new$             \State return $newVm$         \Else             \State return $NULL$         \EndIf     \end{algorithmic}  \end{algorithm}  \end{document}   The view in my LaTeX:    The view in the paper:


I've come across multiple answers on this forum about the correct usage of the word 'though'. Despite all this, I am still not confident about my following sentence. Is 'though' correctly used? -- separated with a comma from its preceding clause. Is it good usage of the word in that context?     Clearly, this is in contrast with the Big Bang Theory, though it is conceivable that the total energy of the Universe is zero.


What is Renly's basis for removing Joffrey?

Related question:   I get that he considers himself a better king than Stannis, but why isn't he ?  Did Renly know about Joffrey being illegitimate? I always thought he didn't and was distrustful that Cersei would accept Ned as Regent.  I think in both the books and the series, Renly finds out Joffrey is illegitimate from Stannis' letters, but rewatching that clips makes me think Renly was with Ned, Varys and LF in the plan to arrest Joffrey and Cersei.  [looks up something]  Oh also . So Renly did know?


what's the difference between i++ and ++i in while loop in C

I know the i++ means return i and then increase 1, and ++i means increase 1 then return i. In this code:   int isTotalAlphabetical(char word[]){ int i = 0; while (word[i] != '\0') {     printf("The %dth is: %d, the char is %c\n", i,isalpha(word[i]), word[i]);     if (!isalpha(word[i])){         printf("now return 0, because the %c is not alpha, it's the %d char\n", word[i], i);         return 0;     }     i++;  } return 1;   }  In this loop, when I move i++ to "while (word[i++] != '\0')" the output will print out info that   The 2th is: 1, the char is p The 3th is: 1, the char is l The 4th is: 1, the char is e The 5th is: 0, the char is  now return 0, because the  is not alpha, it's the 5 char   When I move ++i to "while (word[++i] != '\0')", the output will ignore the first one char. it shows:  The 1th is: 1, the char is p The 2th is: 1, the char is p The 3th is: 1, the char is l The 4th is: 1, the char is e   How could that happen?


Why i am getting this exception?  I am new to java and stackoverflow  ArrayList<A> a = new ArrayList<A>(); ArrayList<B> b = new ArrayList<B>();  a.add(new A("A")); a.add(new A("B")); a.add(new A("C"));  b.add(new B(new A("A"), "a")); b.add(new B(new A("B"), "b")); b.add(new B(new A("C"), "c"));  System.out.println(a); System.out.println(b);  bIterator = b.iterator(); while(bIterator.hasNext()) {     b.add(new B(bIterator.next(), "a")); }   error  Exception in thread "main" java.util.ConcurrentModificationException


Correct way to write these sentences? Which or that?

Should I use "which" or "that" in these sentences. I appreciate they are virtually the same sentence. I don't think it makes a difference here but I speak/write British English (not American English).   The twin room has its own ensuite that/which is equipped with a shower. This stylish room has its own ensuite which/that is equipped with a shower.   Thanks


How to return to original .pdf presentation after open a .pdf linked file?

I'm preparing a beamer presentation and I'm using hyperlinks for the first time; When I do something like:  \href{name_file_to_open.pdf}{here I put a link to a figure which is working well}   It works just fine and open the .pdf document; Problem is I can't return to my presentation, cause when I close the linked.pdf I close it all. (I try this with movie and indicating an area to the file open like \href[width=3cm,height=2cm] but then it doesn't work)  Can anyone please has any suggestion to this problem?


How can I get multiple instances of GNOME Calculator at same time?

I need multiple calculators at the same time. But when I click on the calculator icon it just refers to the one that is already opened.  How can I do this in Ubuntu 18.04?