Java if and else if statements not producing an output

I am new to Java and I thought I'd do some practice on my own with Scanners and Boolean. My problem is that when I run the code below, the program doesn't output anything that is within the if or else statements.   My question is: how to I make the code print out the output within the if and else statements?  The code is:   import java.util.Scanner; public class ScannerPractice {     public static void main(String[] args)     {         System.out.println("\tHello!");         System.out.println("\tPlease enter you're name.");          Scanner input= new Scanner(System.in);         String name;         name= input.next();          System.out.println("\tYour name is " + name + "?"  );          String yn;         yn= input.next();          if (yn=="yes")          {             System.out.println("\tThats a good name");         }         else if (yn=="no")         {             System.out.println("\tWhy did you lie to me?");             input.next();             System.out.println("\tI don't think I can forgive you\n\tGoodbye forever!");         }     } }   Thank you in advance.


I am a student of biology at a State school in New York (SUNY), and my school is very liberal arts focused, I am also a racial minority.  I also have a poor GPA, 2.7ish currently, due to failings of a previous major(in computer science i received F's for 2 classes, and a D for one).  I am trying to do undergrad research, but only have 2 potential presentable results up and coming.  Do grad schools typically fund students like me to get their tuition totally waived and a possible small stipend? What can I do to better my odds at securing such a position? It is the only way I could even consider grad school.


How to remove the orphaned SPD Workflow Instance using PowerShell

How to clean-up or remove the orphaned workflows in a  site collection?   I have created a SPD 2010 reusable workflow and deployed in SP 2013 environment. But for some of the sub sites and some document libraries I am unable to trigger this workflow.   So I want to delete the existing workflow instance which is associated with the content types from this site collection.  Is there any PowerShell script to do this job?


How can I merge several UV images into one UV image?

I have created several space ships using up to 7-8 single images to texture the objects. As I am a blender beginner I did not unwrap the models and create a texture from the unwrap; instead, I just unwrapped the models and used a lot of different images on their faces.  Now that I want to use the model (I use it in Unity 3D) there are a lot of materials on the objects, one for each image I used. For mobile game performance I'd like to have one single image for each model, including all textures I used.  Is there any way to merge all used images (with their UV mapping still intact) to one big image which will be imported as one single material for the model in unity?


Got one reputation point on StackOverflow without any explanation

Today when I logged into my Stack Overflow account it showed me that I had got one reputation point. But when I clicked on the "Recent achievements" button on top bar there was no explanation for it. This is how it looked like to me:    Any one knows why was I awarded one reputation point?


React - A More Comprehensive Email Validation

I'm looking to do a more comprehensive email validation than the one I currently have. If you take a look at my code, I'm only checking for @ symbol and ends in .com. Is there a more comprehensive validation check I can include into my current code configuration?   JS:  this.state = {   inputs: {     name: '',     email: '',     message: '',   },   errors: {     name: false,     email: false,     message: false,   }, };  handleOnChange = e => {  const { name, value } = e.target;  if (name === 'email') {   this.setState({     inputs: {       ...this.state.inputs,       [name]: value,     },     errors: {       ...this.state.errors,       email:         (value.includes('@') && value.slice(-4).includes('.com'))           ? false           : true,     },   }); } else {   this.setState({     inputs: {       ...this.state.inputs,       [name]: value,     },     errors: {       ...this.state.errors,       [name]: false,     },   }); }   };


Call/Invoke a method based on a string value contained in an array

I have a struct-array that contains details of different reports that can be run.  Each report calls a different method and currently the program has to manually check the selected report value to specifically call the appropriate method.    I would like to store the method name in the struct-array and then have program invoke that method when there is match.  Is this possible?  Currently:  if (this.cboSelectReport.Text == "Daily_Unload") {    reportDailyUnload();  }   Ideally:  if(this.cboSelectReport.Text == MyArray[i].Name) {    something(MyArray[i].MethodName); }   UPDATE  I tired a number of the suggestions below and none of them worked.  They didn't work probably due to how I have my program structured.


Why is 18.04 still using nvidia 390 while current nvidia driver is 410

Just curious as to why the current nvidia drivers are not the latest.   Not a complaint, and not interested particularly upgrading beyond Ubuntu's current drivers.  This is not a GENERAL QUESTION about packages, it is about a specific version of of Ubuntu and also about about specific proprietary drivers, nvidia.


What could be the possible reason for the green border visible in this satellite image ?    ()


This is a sorting algorithm test file. I am getting NullPointer error:  "Exception in thread "main" java.lang.NullPointerException     at Test.loadFiles(Test.java:28)     at Test.main(Test.java:39)"   The problem seems to be with "filecache[x].setName(nameOffiles[x]);" Please guide. Thanks.  import java.io.File; public class Test {    static File folder = new File("D:\\");    static File[] listOfFiles = folder.listFiles();    static String[] nameOffiles = new String[30];    static long[] sizeOffiles = new long[30];    static int i = 0;    static MyFile filecache[] = new MyFile[30];    public static void readFiles(){       for (File file : listOfFiles) {          if (file.isFile()) {             nameOffiles[i] = file.getName();             sizeOffiles[i] = file.length();             i++;          }        }        i = 0;    }    public static void loadFiles(){       for(int x = 0; x <nameOffiles.length; x++){          filecache[x].setName(nameOffiles[x]);          filecache[x].setSize(sizeOffiles[x]);       }    }    public static void testFiles(){       Sorting sort1 = new Sorting();       sort1.quickSort(filecache);    }    public static void main(String[] args) {       readFiles();         loadFiles();       testFiles();       for(int x = 0; x < filecache.length; x++){          System.out.println(filecache[x]);       }    } }


Resolve the error "An illegal choice has been detected..."

I have written code like below and all works fine, but while submitting the form I get the error below. I am trying to filter the second dropdown based on the first drop down selection.     An illegal choice has been detected. Please contact the site administrator.   How do I overcome that error?       function dynamic_location_dropdown_form_alter(&$form, $form_state, $form_id) {   if($form_id == 'product_node_form') {    $location_options = array();    if(isset($form['field_destination']['und']['#default_value'][0])) {     $destination = $form['field_destination']['und']['#default_value'][0];   }   else {     $destination = 0;   }    $location_options = dynamic_location_dropdown_locations($destination);    $form['field_destination']['und']['#ajax'] = array(     'event' => 'change',     'wrapper' => 'squadron-wrapper',     'callback' => 'dynamic_location_dropdown_ajax_callback',     'method' => 'replace',   );   $form['field_product_location']['#validated'] = true;   $form['field_product_location']['und']['#prefix'] = '
';   $form['field_product_location']['und']['#suffix'] = '
';   $form['field_product_location']['und']['#options'] = $location_options;   } }  function dynamic_location_dropdown_ajax_callback($form, $form_state) {   $country_id = $form['field_destination']['und']['#value'];   $form['field_product_location']['#validated'] = true;   $form['field_product_location']['und']['#options'] =  dynamic_location_dropdown_locations($country_id);    return $form['field_product_location']; }  function dynamic_location_dropdown_locations($destination_id) {   $nodes = array();   $nodes[''] = '- None -';   if($destination_id != '') {     $select = db_query("       SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created       FROM {node} node       LEFT JOIN {field_data_field_location_country} field_data_field_location_country        ON node.nid = field_data_field_location_country.entity_id        AND (field_data_field_location_country.entity_type = 'node'        AND field_data_field_location_country.deleted = '0')       WHERE (( (node.status = '1')        AND (node.type IN  ('location'))        AND (field_data_field_location_country.field_location_country_nid = $destination_id)))       ORDER BY node_title ASC     ");     $nodes[''] = '- None -';     foreach ($select as $node) {       $nodes[$node->nid] = $node->node_title;     }   }    return $nodes; }


How to route a specific resistance differential pair?

I've done a few basic boards and I've decided to try my hand at a basic Raspberry Pi Compute Module board. From the :     The USB port (Pins USB DP and USB DM) must be routed as 90 ohm differential PCB traces   Similar notes exist for other devices but USB is the one I'm most interested in. I understand how routing a matched impedance differential pair works but I've never encountered the need for a specific resistance value for the traces. So my question is...  Considering there is a relatively short distance between the pin and the USB transceiver chip, how do I design for a specific resistance? Is it acceptable to add a resistor in line with the PCB trace to tune this, or must it be done in copper? Is the impedance value supposed to be derived solely by adjusting the trace width/length?


Javascript not replacing single character

This code does not work    var x ='hello'; x[2] ='a';   Why doesn't it work? I am not using the replace() function


Why is it hard to prove whether $\pi+e$ is an irrational number?

From  I came to know that it is hard to conclude $\pi+e$ is an irrational? Can somebody discuss with reference "Why this is hard ?"   Is it still an open problem ? If yes it will be helpful to any student what kind ideas already used but ultimately failed to conclude this.


I've got an array of arrays like this :  Array(     [id1] => Array (            /* details */            [unique] => 3           )     [id2] => Array (            /* details */            [unique] => 5     [id3] => Array (            /* details */            [unique] => 1     ) )   Question : How could I sort it by the unique field, so that it is converted like the one following?  Array(     [id2] => Array (            /* details */            [unique] => 5           )     [id1] => Array (            /* details */            [unique] => 3     [id3] => Array (            /* details */            [unique] => 1     ) )


Any two bases of a finite dimensional vector space must have the same number of elements.

Prove that any two bases of a finite dimensional vector space must have the same number of elements.  By considering the following two bases  $$S_1 = \{ \alpha_1, \alpha_2 , \ldots, \alpha_n \},$$  $$S_2 = \{ \beta_1, \beta_2, \ldots, \beta_m \},$$  how do I show that $m = n$?  Hints to get started. Thanks very much.


How can I convert a string into a JSON object in JavaScript?

I'm trying to convert the following JSON string into an object: {     "purpose": "This is test",     "suffix": "test_suffix",     "tags": {         "environment": "development",         "provider": "Test"     },     "new_tag": "1234",     "disk": "{data0 = { size = \"128\", caching = \"None\", type = \"Premium_LRS\" }",     "customer": "1234" }  How can I do so?


How to set application in port mode only? I does not wanna when phone landscape is on my application should still work in port mode dose not change to land mode.


How get a shortcode working in category description

I want to use a shortcode for a table in a category description. It's my understanding that WP does not support this. I searched google and found some codes that i needed to add to the functions.php. But it's not working for me. What should I do?  Site/page:


When the load_upload() function gets executed, I want an explorer window to automatically open, so the user can select a file ($(imageFileInput).click();), and when a file is selected, I want the form to submit automatically.  The problem is that, when the form is generated dynamically as seen below, changes are somehow not detected. This seems to make it impossible to automatically submit the form when the value of imageFile changes.  How could I automatically submit the form this way? Any help is much appreciated!  function load_upload() {     var form = document.createElement('form');     form.method = "POST";     form.action = "image_upload_process.php";     form.id = 'imageForm';      var imageFileInput = document.createElement('input');     imageFileInput.type = "file";     imageFileInput.id = 'imageFile';     $(imageFileInput).click();     form.appendChild(imageFileInput);      document.body.appendChild(form); };   My change event:  jQuery(document).ready(function($) {     document.getElementById("imageFile").onchange = function() {         document.getElementById("imageForm").submit();     }; });


iMac with black screen, backlight on, no activity

I'm having a problem with a 5k iMac 27" (mid-2015). When I turn it on, the backlight comes on, but the screen is completely black and there’s no activity. An external monitor (plugged in with a Mini Displayport / Thunderbolt to HDMI cable) works, but only after I log in. I can do that by selecting the user and typing in my password blind, although it doesn’t work every time. So I restart it, wait a minute, try to login, wait a minute, then if it doesn’t come on I restart and try again. When it does work, the computer seems to be working fine. It connects to my wifi (again only after login) and everything is fine, except that the built-in screen is black. The system recognizes the built-in display and thinks it's working (unlike the Macbook Pro in this ). It is also powering the backlight.  Some background: A few months ago I opened it up and swapped out the HDD for an SSD (with a kit from OWC). It worked afterward, but some of the backlights stopped working, giving a look like stripes of dimness at the bottom of the screen. I needed to order more adhesive strips before I could open it up and re-seat the ribbon cable, so I left it and never got around to it. It worked for several months. Then one day the screen went black. I turned it off and back on, and the backlight came up but that was all. I tried resetting the NVRAM, reseating the RAM chips, and then gave up and put it in the garage until I had time. Yesterday I got it out and plugged it in. To my surprise, the screen came on and it appeared to be working fine! I walked away to grab a keyboard, and when I got back the screen was black again and it hasn’t come on since. I plugged in an external monitor and after a lot of messing around figured out I that I can login blind, and once I do the monitor comes on. I’m assuming there is a hardware issue, probably connected to something I messed up when I swapped the drive. I’m ready to open it up again but I’m not sure what to look for. What are the likely causes of this issue?


How to determine the acute angle bisector of given two lines

If we have two lines given by the equations:   $$ax+by+c=0$$  $$px+qy+r=0$$  We know that the two angle bisectors are represented by the equations  $$\frac{ax+by+c}{\sqrt{a^2+b^2}}=\pm\frac{px+qy+r}{\sqrt{p^2+q^2}}$$  Is there any simple way to distinguish between the two angle bisectors? That is, can we tell which sign will give the acute angle bisector and which the obtuse? I tried using the fact that the angle between the acute angle bisector and one of the lines will be less than 45 degrees,but the formula for that is too hairy.  I remember reading somewhere that if $c, r$ are of the same sign and $ap +bq$ is negative then the positive sign gives the acute cangle bisector. I tried it out for some values in a graphing programme and it does seem to work. But I was not able to come up with a proof.


Set the selected option of a html combo box from a parameter

I've got a combo box with options, what I want is a function where I send one of the options, and the combo box set that option to the selected one, showing it.  I try  $("#cmbStrategies option:selected").html('Condor');   It works set Condor as the selected option, but adding it has a new option, resulting in two option Condor.  I want just select the option but not adding a new one.


How to keep the line cap when clipping a path?

This question is kind of the opposite of . Is it posisble to clip a path but let the line caps lokk as the path would end at the clipping area.  basic example  \documentclass[border=10mm]{standalone}  \usepackage{tikz}  \tikzset{line/.style={blue,line width=10mm}}  \begin{document} \begin{tikzpicture}     \draw (0,0) grid (5,5);     \clip (0,0) rectangle (5,5);     \draw [line] (0,1)  -- (5,4); \end{tikzpicture} \end{document}   With the output    but the desired output is    I want to clip a plot in this way and I cannot specify it in a way that the domain equals the clip box, so I must use a clip box, but I don’t want to loose the regular line caps …  more realistic example  Case 1: I want to set the yrange of the two plots according to the y axis, but gnuplot writes all data points to the table file, even if they are out of range (they are marked with an o in a third column, whereas i indicates that the point is in range). It is possible to set xrange in a way that the plots start at the same y value but this is a lot of try and error, since the xrange mus be found individual for every plot.  Case 2: I got a curve that is define by some points an the first and the last of them must be roots, i.e. y = 0. The problem is that the second root lies out of the axes bounds … I guess I could use the (coord)!pos!(coord) syntax but this is try and error again to let this curve end at the same x value as the plots.  \documentclass[border=10mm]{standalone}  \usepackage{tikz}  \tikzset{line/.style={blue,line width=10mm}}  \begin{document} \begin{tikzpicture}     \def\yzoom{50}% needed to prevent overflow     % Axes     \draw [<->] (0,0.07*\yzoom) |- (10.5,0);     % Clip     \clip (0,0) rectangle (10,0.07*\yzoom); % CASE I     % Plots     \draw [line width=2pt,line cap=round]         plot [smooth,raw gnuplot, id=\jobname-plot] function {%             set xrange [1.4:10];             set yrange [0:0.06*\yzoom];             set samples 100;             f(x) = \yzoom*(0.26/(x-1) - 1/(x**2));             plot f(x);         };     \draw [line width=2pt,line cap=round]         plot [smooth,raw gnuplot, id=\jobname-plot] function {%             set xrange [1:10];             set yrange [0:0.06*\yzoom];             set samples 100;             f(x) = \yzoom*(0.28/(x-1) - 1/(x**2));             plot f(x);         }; % CASE II     % Curve, defined by three points.     % P1 and P3 must have y=0     \draw plot coordinates {(2,0) (5,2) (18,0)}; \end{tikzpicture} \end{document}   Unclipped output:    Clipped output but the round caps are missing …


I have written a trigger to remove the duplicate insertions but it allows duplications   please check it once where sholu i mistaken  this is my trigger   trigger DuplicateCateCase on Case(before insert,before update) {       Set<string> accountname= new Set<string>();      Set<string> integrationtoo= new Set<string>();        for(Case cas: Trigger.new)      {        accountname.add(cas.Account.Name);        integrationtoo.add(cas.IntegrationTo__c);       }     List<Case> duplicatecaseList = [Select id,Case.Account.Name,IntegrationTo__c,SFType__c From Case where Case.Account.Name= :accountname AND IntegrationTo__c =:integrationtoo];     Set<string > duplicatecaseIds = new Set<string >();     for(Case dup: duplicatecaseList )    {      duplicatecaseIds .add(dup.Account.Name);       duplicatecaseIds .add(dup.IntegrationTo__c);       }     for(Case s : Trigger.new)    {         if(s.Account.Name!=null && s.IntegrationTo__c!=null)         {            if(duplicatecaseIds.contains(s.Account.Name) && duplicatecaseIds.contains(s.IntegrationTo__c))            {              s.addError('Record already exist with same Name');            }           }    }   }  ThAnks


Lualatex beamer breqn: Text appears four timestimestimestimes, why and how to mitigate?

In the following example, why does the word Spam appear four timestimestimestimes?  $ cat mwe.tex  \documentclass{beamer} \usepackage{breqn} \newcommand{\spam}{\textrm{Spam}} \begin{document} \begin{frame} \[ \spam \] \end{frame} \end{document}     ...and what can I do to get it just once?  I'm using:   LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238), beamer 2015/01/05 3.36, breqn 2015/08/11 v0.98d.


I have a two different Datatables  datatable1: customer, product, shippedqty datatable2: customer, product, febforecast, marforecast, aprforecast   Here  Customer and product columns are same  I need to compare datatable1 with datatable2  on customer and products columns and i need to get the result set into new datatable as  customer,product,dhipedqty,febforecast,marforecast,aprforecast   This is what i've tried:  var tablesJoinend = from t1 in dt.Rows.Cast<DataRow>()                      join t2 in forecastdatatable.Rows.Cast<DataRow>()                      on new { A = t1["Customer"].ToString(), B = t1["ProductCode"].ToString() }                      equals new { A = t2["customer"].ToString(), B = t2["NDC"].ToString() }                      select t1;   Now i have tried this which it was not worked  var results = from t1 in dt.Rows.Cast<DataRow>()                               join t2 in forecastdatatable.Rows.Cast<DataRow>() on new { A = t1["Customer"].ToString(), B = t1["ProductCode"].ToString() } equals new { A = t2["customer"].ToString(), B = t2["NDC"].ToString() }                               select new                               {                                   CustID = Convert.ToInt32(t1["Customer"]),                                   ColX = Convert.ToInt32(t1["ProductCode"]),                                   ColY = Convert.ToInt32(t1[3]),                                   a = Convert.ToInt32(t1[4]),                                   xx = Convert.ToInt32(t2[4]),                                     qq = Convert.ToInt32(t2[5])                               };


What would be the intuitive interpretation of the ratio of probability and cummulative density function during the first stage of Heckman selection model?  Is it the likelihood of selection for the sample?


Is it safe to replace a Furnace pressure switch with one of a different rating?

So I had some problem with my gas furnace and a technician came by to install a new one but it doesn't have the same rating and only has one tube instead of two. He assures me it's fine but I thought all furnace repairs had to be made with OEM parts? Can anyone let me know if this is safe and if it will affect the life of my furnace?  The furnace is a Lennox ML195 Single stage 95% efficiency furnace. He replaced the whole pressure switch but the new one has only one port whereas the old one has two, so now there is a hose that is unconnected on one end. Also the old pressure switch has a rating of 0.90 PF and the new one says 0.27" WC is that the same?


I am currently using Ubuntu 14.10. Steam is showing up in the Ubuntu Software Center, but when I click on it it says:      Not found   There isn't a software package called "steam" in your current software sources.         Is there a fix for this? Am I the only one having this problem?


Mean Squared Error (MSE) of parameter $p$ in binomial distribution: intuition

Let $X \sim Bin(n, p)$ and let   $$\hat p = \frac{X}{n} $$ be an estimator of the probability $(p)$ of success in this binomial distribution, where $X$ is the number of successes and $n$ is the number of trials.  My question is, why does $\text{MSE}(\hat p)\rightarrow 0$ as $p \rightarrow0 \, \text{ or }\, 1$?


Why does if statement never equal "0" or "1" ? I print variable "line" and it is a "0" or "1". But IF statement never works.

/**  * @(#)StringToFile.java  *  *  * @author   * @version 1.00 2016/2/14  */ package StringToFile; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List;   public class StringToFile {  public static void main(String[] args) throws IOException {   read("0"); }  public static String read(String msg2) throws IOException {   This is hard coded read of text file  List<String> lines = Files.readAllLines(Paths.get("g:/dungeontreasure/DMJ-solito-v2.12/test.txt"), Charset.defaultCharset()); for (String line : lines) {   msg2 is assigned what was read from text file. I hope.  msg2 = line; //  I assign msg2 what was read from file.   Now, I print out the contents of the text file. this part works.  System.out.println("line read:" + line); // I print out line   Now I check if the text file had a "1" in it, but this never works.  if (msg2==("1")) {     System.out.println("check read: " + msg2);  // check to see what we read. But this never works.          }   Now I check if the text file had a "0" in it, but it never works.  if (msg2==("0")) { System.out.println("check read: " + msg2); // check to see what we read.             }  }    return(msg2); }  }


Performance consideration when using an out parameter and return value?

What would be the performance difference when getting result from return value and from output parameter of a function in c#?


pgfplots: how can I scale to text width?

This question led to a new package:      When I try to scale a plot with: width=\textwidth there is some horizontal space between the start/end of the plot and the start/end of the margins, see this example:  \documentclass[10pt,a4paper]{report} \usepackage[latin1]{inputenc} \usepackage{palatino} \usepackage{color} \usepackage{pgfplots} \usepgfplotslibrary{dateplot}  \pgfplotsset{compat=1.3}  \begin{document} \setlength{\parindent}{0ex}  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.\vspace*{2ex}  \begin{tikzpicture} \begin{axis}[ height=5cm, width=\textwidth, grid=both, minor x tick num=4, minor y tick num=4, major tick length=0.15cm, minor tick length=0.075cm, tick style={semithick,color=black},  date coordinates in=x, xticklabel=\day.\month., date ZERO=2009-09-02,% <- improves precision! ]  \addplot[color = black, mark=diamond*] coordinates { (2009-08-07, 98) (2009-08-09, 92) (2009-08-12, 94) (2009-08-15, 87) (2009-08-19, 82) (2009-08-26, 65) (2009-08-29, 54) (2009-09-02, 31) }; \end{axis} \end{tikzpicture}  \vspace*{2ex}Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.  \end{document}


Photoelectric effect absorption coefficient decreases with energy, why?

Consider the diagram below:  (Author: Joshua Hykes )  From this diagram we can see that the absorption coefficient for the photoelectric effect generically decreases with the increase in energy of the photon. What is the physical reason for this decrease. (i.e. why does the probability of photoelectric absorption decreases with increasing photon energy).  Note: I am aware that the large spin is due to more inner electrons been able to be lifted.  Edit For Clarity  I will here rephrase the question: in the above diagram there is a general decrease in the absorption coefficient due to the photoelectric effect (i.e. the absorption of a photon by an electron and subsequent emission of that electron) with energy (ignoring the occasional absorption edge). This is of course linked to a decrease in the probability of the photoelectric effect occurring (and a corresponding decrease in the cross section). My question is: what is causing this decrease with increasing energy. (For the purpose of this question I am ignoring the contribution due to the Compton effect and pair production and simply focusing on the cross section due to the photoelectric effect.)


What determines whether or not an animagus can retain their clothes?

In Prisoner of Azkaban, Sirius Black transforms a couple times without any special attention given to his clothes - it's either implied or pretty explicitly presented that his clothes morph with him.  When Peter Pettigrew is first revealed, he is fully clothed after having just been transformed from his animal form.  However, later in the movie, Peter returns to his animal form and leaves his clothes behind - they fall off him before he runs off.  The incident that really caught my attention though, was the train station scene with Sirius Black in Goblet of Fire (or perhaps it was a different movie/book, I'm not sure).  Here, Harry must give Sirius a cloak because he has just morphed from his animal form without any clothes.  All of the above seems to represent a fair bit of inconsistency in the handling of clothes for animagi.  Are there any particular rules governing when an animagus may retain their clothes throughout their transformations?  My primary experience with the Potterverse thus far has been through the movies, so it may be the case that the books handle this differently and I just don't know.  Are the movies an accurate representation of the books, in this respect?  Do the books offer any further explanation for this?


How can I disable the purple splash screen at boot?

How can I disable the purple "Ubuntu" splash screen that displays at boot before the login screen has loaded? I'd prefer to just see plain text scroll by.


Terminal showing me a different hostname almost every time?

I am on 10.15.7. Ever since I got this new Macbook (2020 model) I've been noticing something weird: Almost every day when using Terminal I am seeing a different host name. I am talking about the "pc-8" part here:  My machine is simply called "LBs MacBook Pro" under the "Sharing" settings. I have been seeing lots of different host names, for example  "android" "roberts iphone" "web"  And so on, seemingly random names of network enabled devices. This happens both at home and in my office. However, at both locations I am using a strongly protected ISP provided wireless router that only I know the password to, since I live and work alone. The router also does not have any kind of network sharing capatibility. Also, this does not only happen with Terminal but also with other shell applications such as iTerm. Usually this would not bother me too much but since I keep on seeing these new names I am just wondering how this can happen?


facl ignoring the "x" permission but only on files

When I use setfacl to manage on what permissions should the children files / directories have, for some reason the files have all the permissions except the execute ("x") one.  someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ getfacl . # file: . # owner: someuser # group: webs # flags: -s- user::rwx group::rwx other::rwx default:user::rwx default:group::rwx default:other::rwx  someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ touch file someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ mkdir dir someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ ls -l total 4 drwxrwsrwx+ 2 someuser webs 4096 paź 31 13:35 dir -rw-rw-rw-  1 someuser webs    0 paź 31 13:35 file   I thought it has something to do with umask but changing it in various ways never gives the expected result unless I'm missing something.  How can this be fixed?


Is there a word for the feeling/situation where we almost remember a thing/word/scene,etc. but are not able to exactly recall it. For example, the other day I was trying to recall the author of the book Contact (i.e. Carl Sagan). I wasn't able to exactly recall 'Carl Sagan' but was in that situation where I could feel I almost remember it. I could recall there was the letter 'C' in his name. Finally after some effort I could recall the exact name 'Carl Sagan'. Is there any word for such a feeling/situation? EDIT:  The feeling is not necessarily of trying to remember a single word(as in from vocabulary). It could be trying to remember a movie or an experience that you were a part of, etc. Eg: If say I was with friends and we were having a conversation. After few days I was able to recall a statement said by someone, but wasn't able to remember by whom; i.e. I had a clouded recollection and I could almost remember but not really.


How to show via induction the product rule for derivatives?

Hi I have to show by induction over the number $n$  the following product rule and I have no idea about it. Could someone provide me the proof and a nice explaination:  $$(f\cdot g)^{(n)} (x)= \sum_{k=0}^n\tbinom n k f^{(n-k)} (x) g^{(k)} (x)$$  The $h^{(k)}$ is the $k`th$ derivative of the function $h^{(0)} := h$  I have to use the in my induction proof rhe recursion formula (Pascal Triangle)  $\tbinom n k = \tbinom {n-1} k + \tbinom {n-1} {k-1}$  with $n>k>0$


Locally reduce space between equation and qed / placement of qed

If (using amsthm) I have a proof which ends on an equation, and after that some text goes on, I have something like:   text / (bit of space) / equation / (bit of space which looks huge because there is nothing in the line with qed) / empty line with the qed / (bit of space) / further text.  Here's a MWE ...  \documentclass{scrartcl} \usepackage[UKenglish]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsthm}  \begin{document}  \begin{proof} Here is a bit of text which explains how the last step will work. The last step will only be some easy equation or some property with no need to write text between this and the q.e.d. \begin{equation*} \int\limits_1^\infty f(t) g(t) dt = \Biggl[ \frac{a^b}{c^d} \Biggr] = \infty  \end{equation*} \end{proof} And then, some other text goes on...  \end{document}   ...and here's a picture of it:    What I would like to have is the qed to move to the blue position (that is the "lower border" of the equation line).  I tried inserting \vspace{-...} which - no matter if I put it in the equation, between the equation or the proof - will just move the text of after the proof upwards (yellow arrow) while leaving the rest unchanged. I also tried \qedhere in the equation's line, which is almost what I would like to have but then the qed is centered in the equation line (indicated in red).


My house is big enough I followed all instructions but it still won't work. I tried making it 7x5 but NPC's still won't move in.   Is it because the house is made of dirt, mud, bricks, and stone? How do I get NPC's to move into my house?


How a 32 bit number stored in 64 bit processor with 32 bit OS?

When a 64 bit OS runs on a 64 bit processor, the processor processes the whole 64 bit (8 bytes) in one go. Suppose a 32 bit OS runs on a 64 bit processor, how is data extracted? Is 32 bits (4bytes) extracted or whole 64 (8 bytes)? Is that 32 bit (4byte) data stored like 32 bits storage wastage and 32 bits as data ? Like (32bit(zeroes) +  32 bit (data)) for 64 bit processor 32 bit OS?


Started to delete /usr/share by mistake: what to do now?

In Ubuntu 16.04, I ran by mistake sudo rm -rf /usr/share. I know how stupid that is (I wanted to remove /usr/share/somefolder that had been installed as root and got distracted). I interrupted it after about 5 seconds. I can already see some strange things: some text is not displaying on askubuntu.SE in firefox, when I open a terminal I get /etc/zsh/zshrc:111: compinit: function definition file not found, autocompletion returns an error, etc.  My question is: what should I do now?   Edit I install debsums and followed the steps in  to . With the command sudo debsums -cs, I could see that a lot of things where broken. However, I could not fix that other than by reinstalling (see my more detailed answer).


OutOfMemoryError when not actually out of memory

I've got a javaws (JNLP) app that will occasionally give  java.lang.OutOfMemoryError: Java heap space   but right after it happened the customer hit "m" in the console (to get memory usage) and "g" (to trigger an manual full GC) and I see  Memory: 1,013,632K  Free: 167,815K  (16%) ... completed. Garbage collect ... completed. Memory: 1,013,632K  Free: 760,924K  (75%) ... completed.   which to me looks like plenty of free memory even before the GC and tons after. I've already doubled the memory from what it had before (which was plenty in most cases). The stacktrace is different each time. Can anyone suggest what might cause this and how to fix it?  This is not a duplicate of the other OutOfMemoryError questions! Those are pretty generic, this is asking specifically about a strange case where we seem to get the error when not actually out of memory.


Why is the beginning of a quote in old text sometimes denoted by a capital letter but no quotation marks?

In the following text of Pamela by Samuel Richardson, well is capitalised — possibly to denote speech, where inverted commas have been neglected. As GEdgar points out, this is not an isolated case. I wonder why only, but there may be no explanation:      He took my hand, in a kind of good-humoured mockery, and said, Well urged, my pretty preacher! When my Lincolnshire chaplain dies, I'll put thee on a gown and cassock, and thou'lt make a good figure in his place.—I wish, said I, a little vexed at his jeer. Well, well, Pamela, said he, no more of this unfashionable jargon.


How did the Millennium Falcon get from Hoth to Bespin without hyperdrive?

How did the Millennium Falcon get from Hoth to Bespin without their hyperdrive? Are these locations so close together? I would think not, because Hoth is in the Hoth Sysem and Bespin is in the Bespin System.  The asteroid field in The Empire Strikes Back does seem to be in the Hoth System so there is not really an issue there.  I've looked on this site and on the Wookieepedia but I've yet to find a canon answer. This appears to be such a large plot hole, that there simple must be a canon (EU) explanation.  "", fandom.com  "", fandom.com  "", fandom.com  There is a barely-satisfactory theory here: "", mannveille.com but that does not appear to be endorsed by canon.


What are the real damage figures of defensive buildings?

When viewing a defensive building (and unit statistics), it will show how much damage per second the building/unit does. Considering the cannon only shoots every 2/3 seconds, does that mean cannon damage x 2/3?


Correct grammar form for two people owning the same object?

Which is correct? Paul's and Freda's Anniversary or Paul and Freda's Anniversary?


Show that  $\tan {\pi  \over 8} = \sqrt 2  - 1$, using the identity $\tan 2\theta  = {{2\tan \theta } \over {1 - {{\tan }^2}\theta }}$    Using $\tan 2\theta  = {{2\tan \theta } \over {1 - {{\tan }^2}\theta }}$ with $\theta  = {\pi  \over {16}}$:  $\eqalign{   & \tan {\pi  \over 8} = {{2\tan {\pi  \over {16}}} \over {1 - {{\tan }^2}{\pi  \over {16}}}}  \cr    & \tan {\pi  \over 8} = 0.41421.... \cr} $  I essentially get an answer equivalent to $\sqrt 2  - 1$ but not an "exact" answer, how do I go about this question to get a result in "exact" form?  Thank you.


Windows 10 mkdir in Python Script with Special Character

I think/hope this a an easy question that I just can't find the answer to - how do I create a directory where the title contains a colon? I'm scraping data from a website with variables for section and year, and creates a directory:  if 'C:Path/Data/%s' % stat:                 directory = 'C:Path/Data/%s' % stat                             else:                                 directory = 'C:Path/Data/%s' % stat.replace('/', ' ')             if not os.path.exists(directory):                 try:                     os.makedirs(directory)                 except OSError as e:                     if not e.errno != errno.EEXIST:                         raise   I have some error handling in there based on what's coming back. I had to bring in errno to skip the section that was erring. I want to bring in that data however - and I believe the issue is the title of the section, and thus the directory, contains a : in a directory like:  /Year: some_data/   I receive this error:  OSError: [Errno 22] Invalid argument: Failed with OSError   My question is - how do I create or handle the creation of a directory with a : in the title? I'm just skipping over it for now.  I apologize if this is a duplicate but I couldn't find anything specifically. I'm running python 3.6 in Jupyter Notebook on Windows 10. Thank you.


Help at dismissing a time dilation "paradox"

If Observer A moves at speed $v$ respect to observer B, then there is a time dilation given by  $$t_B=t_A\gamma$$  as is known from special relativity. Here, $t_A$ is the time interval measured by A and $t_B$ is the time interval measured by B. However, a friend of mine asked me about the inverse case, what if we take the frame of reference in which A is stationary and B is moving? in that case,  $$t_A=t_B\gamma$$  In this case, A's time should be dilated with respect to B's, since B is moving away, so we get conflicting results. I know that this case is somehow erroneous, but I am now sure how to justify it. I think that it has something to do with the fact that in the first equation, $t_A $ is the proper time, and that is the one that is dilated, but I have been unsuccesful at developing a convincing enough argument. How can I solve this "paradox"?


How to make a program use python2.7 instead of default python3.4 on ubuntu 14.04

I am using ubuntu 14.04 and I have a program that depends on python 2.7 and does not support any of python 3.x. Ubuntu 14.04 comes with python3.4 by default. I would like to know if there is a possibility to make my program uses python2.7 instead of the default version. I thought about uninstalling python3.4, but I think it is not a good idea as some other programs may depends on it.   Thanks


Trying to build a web page that can generate an image

I've been having trouble getting started with this project because I'm not sure what I should be searching for. Any help on where/how to start would be greatly appreciated.  The idea is, I have an image of a postcard that I want users to be able to upload and add their logo to a designated blank area and then download it. Hopefully all through a single web page.  If it can be all be done locally through their browser without actually uploading anything to my web server, even better!  So, I'm trying to figure out what I should use to accomplish this.  Thank you again in advance for any suggestions and help!


So I have a lab problem I need help with. I need to write a function that has a name parameter that includes the person's entire name. Ex) "John Quincy Doe". From that input, my function has to return the last name with a comma, then the first name and middle initial. Ex) "Doe, John Q". I have the right idea of checking for space and then breaking them into substrings, but how do I go about doing that in C++?


rise: wages: an increase in wages(= raise American English)  raise: an increase in the money you earn(= rise British English)  I have extracted those from Longman.  So, are the bold terms are interchangeable in this situation?


find joint distribution $\min (X,Y)$ and $W$, where W is a discrete distribution

Let, $X,Y$ are independent rv with pdf.s $f_X(x\mid \lambda)=\dfrac{1}{\lambda}e^{-x/\lambda}$, $x>0$ and $f_Y(y\mid \mu)=\dfrac{1}{\mu}e^{-x/\mu}$, $y>0$. Let $Z=\min\{X,Y\}$ and $W=1$ if $Z=X$ and $0$ if $Z=Y$ Find joint distribution of $(Z,W)$?  I found pmf of $W$ which is $f_W(w)=\Big(\dfrac{\mu}{\lambda+\mu}\Big)^w\Big(\dfrac{\lambda}{\lambda+\mu}\Big)^{1-w}$ But have problem while calculating $P(Z\leq z, W=1)$. $P(Z\leq z, W=1)=P(Z\leq z\mid W=1)P(W=1)=P(X\leq z)P(W=1)$ The last line does not look right to me. What should I do? Thanks for any help!


Does switching the bard incantation stat from charisma to wisdom create major balance issues?

I have a player who want to play a shaman. He really wants to keep the bard classes but he is much more interested in the druid lore. He doesn't want to be charismatic and handle social interaction, he wants to focus it's music around nature and worship nature-related deities. Therefore he was asking if he can have a bard with wisdom as the incantation  characteristic.   I'm about to say yes, but I'm new and I don't know if there is major balance issues that will come up and that I didn't foresee.


I want to know if its "legal" to run Mac OS X in non apple hardware.   If not, what is the point of having to run Mac OS X in a apple hardware, when apple hardware is running Mac OS X already.


how do i copy data in javascript which is passed to function

What is the best way to copy text to the clipboard (multi-browser)? The below code  which I have tried.  function copy(data){        let info = data;        document.execCommand("copy");        alert("Copied the text: " + info);    }  I am trying to copy data which I have passed.


"Boatload of things" - singular or plural?

One of those automated grammar checking tools pointed this out to me.  I have a sentence, "There are a boatload of other options."  The are in this sentence gets flagged as not agreeing with the form of boatload as singular.    boatload in this usage would seem to be plural, and saying is a boatload of other options sounds strange.  Which is the correct usage?


I want to save the profile picture, and I want to know what is the best option.  -Saving the path in the DB and load the image according to his location.  -Save the whole image.  I'm using EntityFrameWork and SQL server Database


How to capture the output of the strings command?

How do I capture the output of the strings command into a .txt file from the command line?


A question about the higher-order Weyl variation for the geodesic distance

I have a question in deriving Eqs. (3.6.15b) and (3.6.15c) in Polchinski's string theory vol I p. 105.   Given      $$\Delta (\sigma,\sigma') = \frac{ \alpha'}{2} \ln d^2 (\sigma, \sigma') \tag{3.6.6}$$   where $d(\sigma,\sigma')$ is the geodesic distance between points $\sigma$ and $\sigma'$.   It is said for the Weyl variation $\delta_W$,     $$\partial_a \delta_W \Delta(\sigma,\sigma')|_{\sigma'=\sigma}= \frac{ 1}{2} \alpha' \partial_a \delta \omega(\sigma) \tag{3.6.15a} $$   $$ \partial_a \partial_b' \delta_W \Delta(\sigma,\sigma')|_{\sigma'=\sigma}= \frac{ 1+ \gamma}{2} \alpha' \nabla_a \partial_b \delta \omega(\sigma) \tag{3.6.15b} $$   $$ \nabla_a \partial_b \delta_W \Delta(\sigma,\sigma')|_{\sigma'=\sigma}= - \frac{  \gamma}{2} \alpha' \nabla_a \partial_b \delta \omega(\sigma) \tag{3.6.15c} $$   Here $\gamma=-\frac{2}{3}$.   I know the reason for the factor of $1/2$ in the RHS of Eq. (3.6.15a) and I can derive it. But, putting $\nabla$ on LHS and RHS of Eq. (3.6.15a) will not lead to (3.6.15c). I guess it is because there is some higher-order terms in the geodesic distance where the treatment of (3.6.9)-(3.6.11) omitted. But I don't know how to get it. I tried $ds^2= g_{ab} dx^a dx^b= (\eta_{ab} + h_{ab})dx^a dx^b $ to separate the deviation of Minkowski metric, but I cannot get the factor $\gamma$   My question is, how to derive Eqs. (3.6.15b) and (3.6.15c) (especially there is a prime, $'$, namely $\partial'_b$ in the LHS of (3.6.15b) but not in the RHS)


Subrings of polynomial rings over the complex plane

I have the following questions:   (i) must every subring of the polynomial ring in two variables over the complex plane, containing the complex plane itself, be Noetherian?  (ii) Are there Noetherian rings containing the complex field which are not f.g. as a ring over the complex field (maybe the field of rational functions over the complex plane? is this f.g. as a ring over the complex field?)?


What is error code 495 on Google Play and the YouTube app?

"Facebook" could not be downloaded due to an error. (495)   How do I solve this error?


Why does my job control fail inside a loop?

My bash script is supposed to start a process (let's say, run less) and bring it back to foreground every time the process is suspended (e.g. by pressing CTRL-Z).  If I just keep repeating the commands, it works as expected:  #!/bin/bash set -m echo foo | less # (User presses CTRL+Z to suspend the process) echo "going back..." sleep 1 fg # (User presses CTRL+Z to suspend the process) echo "going back..." sleep 1 fg # ... etc.   However, it fails inside a loop:  #!/bin/bash set -m echo foo | less while true; do     echo "going back..."     sleep 1     fg done   Why does the second script exit the second time I suspend less and not keep looping? Am I missing a side effect of what loops in bash do?


An error produced when using the caption package

My .tex file:  \documentclass[a4paper,twoside,portrait,12pt,openright,final,pdflatex]{report} \usepackage[bindingoffset=8mm]{geometry} \usepackage[T1]{fontenc} \usepackage{arabtex} \usepackage{utf8} \usepackage{graphicx} \usepackage{float}  \usepackage{caption} \captionsetup{font=small,labelfont=bf} \setcounter{secnumdepth}{3} \usepackage{fixltx2e}  \usepackage{paralist}  \usepackage{hyperref} \hypersetup{pdftex,linktocpage=true,bookmarks=true,colorlinks=true,citecolor=blue,filecolor=black,linkcolor=blue,urlcolor=black,pdfauthor={Ayman Elmasry},pdftitle={Algorithmic Form Generation: A Thermal Building Envelope Design Approach}} \usepackage[all]{hypcap} \usepackage{lipsum}  \begin{document}  \lipsum[1-20]  \end{document}   I compile with pdflatex, and I get this error:  (/usr/local/texlive/2011/texmf-dist/tex/latex/caption/caption.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/caption/caption3.sty Runaway argument? {\caption@CheckCommand \@makecaption {\long \def \@makecaption ##1##2\ETC. ! Paragraph ended before \@gobble was complete. <to be read again>                     \par  l.901         \unskip\kern-2\captionindent\par   When I comment out:  %\usepackage{caption} %\captionsetup{font=small,labelfont=bf}   ... I get an output PDF file with no problems.


What is a buffer overflow and how do I cause one?

I have heard about a buffer overflow and I would like to know how to cause one.  Can someone show me a small buffer overflow example? New(And what they are used for?)


My native language is German and although many people find German to sound like a coughing fit, the language totally lacks an onomatopoeia for coughing (real coughing). Nor can I think of one in English.   Is there an onomatopoeia for coughing? If not, how can I capture it in writing?


I have Ubuntu 18.04 and want to Change/ Customize Login Sound. Currently no sound is played.


How to Make a Rotation on Two Different Axes?

How to achieve a rotation animation like this (GIF below)? Where the text rotates on both orange point and its origin point axes, so it stays horizontal along its rotation. Thanks!


What projection is being used to display in QGIS for Geographic Coordinates

Google/Bing Maps etc. or web mapping applications use WGS84 coordinates. When you moves the mouse on map, you see WGS84 latitude and longitude. Although coordinate system is WGS84, map is projected in Web Mercator on the screen. Spatial data with projected coordinates is in 2D and it's easy to show on screen, because it's in 2D and already a plane coordinates.  I wonder what is projection system QGIS uses for spatial data that has just geographic coordinates.


What is this icon depicting a phone and Wi-Fi together?

After I factory reset my Nokia 6, this icon appeared. I've never seen it before. What is this icon in the highlighted part?


How do I use the Intermediate Value Theorem in this question?

Suppose that $f:[0,1]→\mathbb{R}$ is  a  continuous  function  on  the  interval $[0,1]$,  and  that $f(0) =f(1)$.  Use the Intermediate Value Theorem to show that there exists $c∈[0,1/2]$ such that $f(c) =f(c+1/2)$.  I understand the Intermediate Value Theorem and I know how it is used to prove an equation has a root within an interval. I just don't understand how to approach this question/


Closing suggested edit rejection dialog doesn't bring back review buttons

When I click the Reject button when reviewing a suggested edit on Stack Overflow, it opens a dialog box. If I click the close button, the dialog disappears, but Approve, Reject, Improve, and Skip buttons don't come back. There is still just a disabled button that says "Rejecting...".    There is an error in the JavaScript console too:  Uncaught TypeError: Cannot call method 'data' of null full.en.js?v=4e67ead1b5c6:44 d full.en.js?v=4e67ead1b5c6:44 h full.en.js?v=4e67ead1b5c6:44 StackExchange.init.a stub.en.js?v=e3d47b73fa12:5 (anonymous function) stub.en.js?v=e3d47b73fa12:6 f.event.dispatch jquery.min.js:3 f.event.add.h.handle.i jquery.min.js:3 f.event.trigger jquery.min.js:3 (anonymous function) jquery.min.js:3 e.extend.each jquery.min.js:2 e.fn.e.each jquery.min.js:2 f.fn.extend.trigger jquery.min.js:3 (anonymous function) review.en.js?v=f45b4ec094ea:64 f.event.dispatch jquery.min.js:3 f.event.add.h.handle.i jquery.min.js:3   I'm running Chrome 31.0.1650.57 on Mac OSX 10.8.5.


Construction Of A Cantor-like set with certain property

Is there a way to construct a measurable set $E \subset [0,1]$ with the property that for every interval $[a,b] \subset [0,1]$, both $[a,b]\cap E $ and $[a,b]$\ $E$ have positive Lebesgue measure?  I think you have to construct a cantor set of positive measure and add in each of the intervals that are ommited another cantor like set with positive measure, and continue this procedure indefinitely but I cannot rigorously prove that its correct. Any ideas? Thanks in advance.


I am writing a set of scripts that I want to be portable, but I need to know whether sh on the current platform stands for bash, ksh, or ash. Is there a clear way to do it?  What comes to my mind first is to inspect which shell has which --version:  $ zsh --version zsh 5.0.2 (x86_64-apple-darwin13.0)  $ bash --version GNU bash, version 4.3.39(1)-release (x86_64-apple-darwin13.4.0) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>  This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  $ ksh --version   version         sh (AT&T Research) 93u+ 2012-08-01  $ dash --version dash: 0: Illegal option --  $ pdksh --version pdksh: pdksh: --: unknown option   Apart from being clumsy, this doesn't even produce results in all cases.  Edit  I need it for my bashrc/zshrc/...-like project, where I assign my current working shell to a variable, and use that variable everywhere.  I can't post my code because I need to solve the problem to enable overall cleanliness of my work. Moreover, it would be too much monkeycode... don't misunderstand it, but POSIX compatibility is too narrow to make my project small enough. I'd need to crutch on system configs otherwise.  However, I can post my UNIX Shell defining function:  PROJ_GET_SHELL () {     local PROJ_SHELL="`ps -p $$ | tail -1 | tr ' ' '\n' | tail -1`"     PROJ_local=(pdksh bash dash mksh zsh ksh sh)     for i in ${PROJ_local[*]}     do         if ! [ -z `echo $PROJ_SHELL | grep $i` ]         then             echo "$i"             break         fi     done }   PS. The least bit of research shows that $SHELL doesn't change when running a shell as subprocess.


Question was  Let $$A= \left[\begin{matrix}          a_1 & a_2\\          a_3&a_4\\        \end{matrix}\right]$$ $$P= \left[\begin{matrix}          p_1 & p_2\\          p_3&p_4\\        \end{matrix}\right]$$  Find the matrix $Q$ such that   $$ Q\left[     \begin{array}       \\       p_1\\p_3\\p_2\\p_4     \end{array} \right] = \left[     \begin{array}       \\       1\\0\\0\\1     \end{array} \right]$$ is equivalent to the equation $A^TPA+P=I$  In this question I approached to make $Q$ to $2\times 2$ matrix. but I couldn't get any idea.. I need you genius to help.


Need clarification on what lvm snapshots are and how they work

My understanding of LVM snapshots is that: when a block changes on the origin, the block is first copied (prior to the change) to the snapshot. The block is then changed on the origin as it would normally.  Theoretically, then, when a snapshot is first created, it should contain nothing. then as changes happen on the origin, these blocks start to fill up the snapshot.  However, if for testing purposes I create a small 1G LV, and I put a couple files on it; then I create a 200MB snapshot. As expected, lvs shows LSize of 200M for snap and 1G for origin. But when I mount the snapshot volume, df shows it with a size of 1G. When I examine its contents, I find it contains everything in the origin volume, even though the original files have not been changed.   Why is this? I'm assuming the "mount" command has some logic in it to do a comparison between the origin LV and the snapshot LV? Can someone explain how this works. If I look at the inode numbers for a file on each volume (origin and snap), they are different (as expected because each is its own unique filesystem), but I'm assuming there are some kind of "pointers" that the snapshot uses to reference unchanged blocks on the origin.  along this same vein, I assume that if I copy the snapshot logical volume itself to another location, I will get a subset of the origin's files - only those that have changed. ... But if I first mount the snapshot filesystem, and then do a fileystem-level copy (cp) I'll get everything on the origin as it was when the snapshot was created. Right?


I'm trying to figure out how to generate 3 different random numbers between 50 and 100 using visual basic. My code only prints out the same number three times. Dim number As Integer number = rndNumber.Next(50, 100)  lblATime.Text = number.ToString lblBTime.Text = number.ToString lblCTime.Text = number.ToString


Reduce file size of jpeg image after compression

I need to upload a jpeg picture of maximum size 150 kb. I've got a 500 kb image, after compression I got a 200 kb image. I can't compress it more, so how can I reduce its size without cropping it? ps: I can't convert to another format, I need to upload a jpeg, pjpeg or jpg file.


We know the color of both Harry's and Hermione's eyes but what color are Ron's eyes? Was it ever stated in the books?


Canonically, who was the third rebel survivor of the Battle of Yavin?

According to my officially licenced Star Wars calendar, of the thirty X-wing and Y-wing pilots that participated in the Battle of Yavin, three returned.     We know that Luke and Wedge were two of the survivors, but who (if the calendar is actually accurate) was the third?     Note that it couldn't be referring to Han Solo, as he wasn't one of the original 30 pilots. Additionally, if it counted Han, it would have to count Chewbacca as well.  Wookieepedia tells me that in the Legends continuity, more than three pilots survived, so please limit your answers to the new canon.


How to run a command when a directory's contents are updated?

There is a directory A whose contents are changed frequently by other people.  I have made a personal directory B where I keep all the files that have ever been in A.  Currently, I just occasionally run rsync to get the files to be backed up from A to B. However, I fear the possibility that some files will get added in A, and then removed from A before I get the chance to copy them over to B.  What is the best way to prevent this from occurring? Ideally, I'd like to have my current backup script run every time the contents of A get changed.


"Join this community" doesn't appear for sites not subdomains of stackexchange.com

I just visited Ask Ubuntu (askubuntu.com) while logged into Stack Exchange, and noticed that "join this community" doesn't appear:    It is similarly broken on Math Overflow (mathoverflow.net). It works, however, on all sites that are subdomains of stackexchange.com, like Mathematics (math.stackexchange.com) and Academia.  I'm using Google Chrome version 46.0.2490.86 on Windows 8.1 Update 1.  (I don't know if this can actually be fixed, given how cookie security works, but I figured Stack Exchange should be aware of the issue.)


This is my first post on this forum so I apologise for not knowing how to ask this question in the desired format however I will do my best to make it clear.   First consider: $$  y = \sqrt{2}^{\sqrt{2}^{\sqrt{2}^{\sqrt{2}^{...}}}} $$ Now, we can rewrite this as simply: $$ y = (\sqrt{2})^y $$ Then further rearrange this to: $$ y^{1/y} = \sqrt{2} $$ Thus leaving y to equal both $2$ and $4$, which obviously can't be correct. However, which is correct and why?   Thanks!


Casting two cantrips, both modified by metamagic?

Can you cast one cantrip, modifying it with "Twinned Spell" (Fire Bolt) to target 2 creatures, and then cast another cantrip as a Bonus Action (Fire Bolt), using "Quickened Spell" to target one of the previous creatures or another creature?


Difference in default "ls" and execvp "ls" call

I called "ls" command using the execvp system call from inside a c file. But there seems to be a slight difference.    The exe files in the default ls call are highlighted green But not in my own execvp ls call. Am I missing something?  This is the piece of code that is calling ls.  else if (rc == 0)  {      // child (new process)     printf("hello, I am child (pid:%d)\n", (int) getpid());     char *myargs[2];     myargs[0] = strdup("ls");     // program: "wc" (word count)     myargs[1] = NULL;//strdup("p3.c"); // argument: file to count     //myargs[2] = NULL;     // marks end of array     execvp(myargs[0], myargs); // runs word count     printf("this shouldn’t print out"); }


What does this Array split syntax means in python

(X_train, X_test) = X[50:], X[:50]   How does the split happens here? Please provide the inner explanation.


Why is my laptop both dual core and quad core at the same time

I bought an  with the following specifications , it is clearly stated here that my CPU is dual core    However when i open Window task manager , I was shocked to find out I had four CPU processors running , it now is a quad core CPU    I am confused over whether my computer is quad core or dual core or both , what is happening ???


If $u$ is a harmonic and $g$ is complex analytic, then why is $u(g(z))$ also harmonic.

I tried to do the second derivative of it to satisfy the harmonic equation of $u_{xx} + u_{yy} = 0$. Second derivative is $u'(g(z) * g''(z) + (g''(z))^2 * u''(g(z))$.


Is it possible to become a creative director by starting out as an art director?

I am interested in becoming a creative director, but I have learned that it is not a job you can simply get straight out of college.   Is it possible to become an art director and make your way up to creative director over time? If so, this is the route I'd like to take.


Bluetooth devices are not showing in Ubuntu 20.04 LTS

I recently installed Ubuntu 20.04 LTS and i also intalled third party softwares during the time of OS installation. Bluetooth drivers are downloaded and bluetooth option is showing and it is turning on too but bluetooth devices are not showing in the list. i tried doing everything. intalled blueman but it cant find my devices either.  here is the output of the commoand lspci -knn | grep Net -A3; lsusb `


Are double negatives ever appropriate in English?

I have heard several sentences in which there was a prominent double negative, but the double negative "sounded right".  Is this ever true, or is it just a misleading feeling?  Edited to include an example:  "Did you enjoy the movie?"  "Well, I didn't not enjoy it, but..."  I suppose that may just be bad grammar, but sometimes it seems to be the quickest way to say it.


How did Gandalf survive the fall in the cavern in "Lord of the Rings - The Fellowship of the Ring" and reincarnated as "Gandalf the White"?

In the "Lord of the Rings - The Fellowship of the Ring", while Gandalf the Grey was fighting inflaming demon Balrog, he fell into cavern. So, did he survived the fall or died and reincarnated as "Gandalf the White"? If survived then how does he become "Gandalf the White"?


Sum of positive definite matrices still positive definite?

I have two matrices, which are square, symmetric, and positive definite. I would like to prove that the sum of the two matrices still have the same properties, that is square, symmetric, and positive definite. The first two properties are obvious, what about the positive definite property. Any clue to the proof? Thank you.


How to install \documentclass{aa} on MacTex?

I need to convert a draft to the layout of the journal Astronomy & Astrophysics. My MacTex distribution doesn't recognise the document class, so I suppose I have to install it. I downloaded the "A&A LaTeX macro package" . The downloaded folder includes a bunch of files:  The content of the readme files can also be viewed online at . I suppose what is left to do is to put all those files into the proper location. But where are these locations? I am on Max OS 10.15.3 and I have a fairly recently (Feb 2020) installed MacTex distribution. Cheers!


Is lasso appropriate on full binary dataset? (R)

Y is the dependent variable with the outcome 0 and 1, and so are X1...X140. As far as I know, I can't use the simple lasso regression in order to look at which variables are shrinked down, since we got only binary data.   We also got perfect linear independence, where for example X1 stands for male and X2 for female.  Furthermore, I want to do a cross validation, in order to determine which lambda value is the best.   I was reading, that some people suggested to use grouped lasso regression, but wouldn't a logistic lasso regression be more appropriate? I'm using glmnetand the caret packages, but I couldn't find in the documentation, which solves my problem. Which packages do you know, who can deal with those problems?


How to see my votes count on other users' Comments

Where can I see count of votes casted by me on comments posted by other users.  I can see my question & answer votes count on my user dashboard screen. Can I also see my comments votes count.    Can anyone please point to such query/screen etc.  Note : I am not asking for voting pattern/score on comments left by me.


Is it possible to start lists at a certain number, or alternatively, continue a previous list? I want something like this:  Pets  You could get a cat  Or you could get a dog   Or some less legal options  A tiger  A bald eagle   And of course, if it doesn't have to be real  A leprechaun   But I want to continue the number, so the last item is 5. Can I do this, and if so, how?


How can I boot back into Ubuntu after Windows 10 upgrade?

I had been running Ubuntu 14.04 and Windows 8.1 happily along each other on a Lenovo Yoga 2 for a period of months. Even after an initial Windows 10 upgrade this continued, until last night. Since last night, the computer always boots directly into Windows, even booting from USB seems impossible - which then stops me from running the usual boot repair tools  I checked the BIOS and it looks ok to me. Secure boot is off, the UEFI boot order is: USB, Ubuntu, Windows (all of which appear in the menu). I turned off fast boot in the Windows power options.  I can only assume Windows 10 did something to my computer last night, but I cannot figure out what. How do I restore the grub boot loader if USB boot is not working either?


If I had gone to the party yesterday, I would be very tired today. If I had gone to the party yesterday, I would have been very tired today.   Witch one is correct? 1 or 2?


Some of the internet links on the site are not working, e.g. link #1 in the answer to .  Is there an automatic routine check that all links on the site are active? Would it be useful for authors to get a message if a link in one of their posts is not working correctly?


Macro with default text in user defined package

I made a package to replace my title page and it produces errors on compilation.  Here is a minimum example:  \ProvidesPackage{replacementTitle}[2017 Personal Title Package] \newcommand*{\mynewmacro}[1]{\gdef\@mynewmacro{#1}% } \newcommand*{\@mynewmacro}{default text} \renewcommand*{\maketitle}{% \begin{titlepage} Text before \@mynewmacro\unskip\ and text after. \end{titlepage} } \endinput   This produces two errors:  ./main.tex:51: Missing = inserted for \ifnum. <to be read again>                     P l.51   ./main.tex:51: Missing number, treated as zero. <to be read again>                     P l.51    This is due to the way that I define a macro which can optionally be set externally, but I can't figure out how to fix it.


I know that the answer to that question is to obtain the Elder Wand, but I think that approach doesn't really make sense.   We know that death is not necessary for the Elder Wand to change hands (Grindelwald stole it from Gregorovitch, and Albus obtained by beating Grindelwald in a non fatal duel) which means we know Voldemort didn't have to kill Snape to obtain the wand, that was just one way of doing it.   Snape was a powerful wizard(maybe one of the strongest of the death eaters) and had proven himself more useful than almost any Death Eater(providing years of information on Dumbledore and later killing him), Voldemort probably didn't want to kill him unless it was absolutely necessary.   Couldn't there have been some other way to get the wand from Severus? Like challenging Snape to a non-fatal duel for ownership of the wand, or perhaps even giving Severus the wand and then stealing it, Grindelwald style?


Minecraft Animation: My grass has black texture after render. How Do I Fix?

For some reason when i render my scene in Blender my minecraft grass texture has a black background, not all the grass has the black background but most do and it is an annoyance. I just want to know how to fix it. I didn't change any settings, and I can't seem to find a solution anywhere after googling for an hour. There is a video how ever it is using Blender Render, and I am using Cycles.


Prove $ ∀a, b, c ∈ Z,$ if $ab + ac ≡ 3$ (mod 6) then b $\not\equiv$ c (mod 6).

Prove $∀a, b, c ∈ Z,$ if $ab + ac ≡ 3$ (mod 6) then b $\not\equiv$ c (mod 6).  New to proof work and my problem is I have some general feelings about this problem but don't know how to express it since I'm not familiar enough with modular arithmetic theory.   I've moved forward using the contrapositve to work with.   Prove $∀a, b, c ∈ Z,$  if b $\equiv$ c (mod 6). Then $ab + ac \not\equiv 3$ (mod 6)   I know congruent integers b and c imply $\frac{b-c}{6}$ being perfectly divisible and I know multiplying a same constant $a$ to both numbers does not change their congruence before summing them.   Basically, I'm stuck here. I think that $ab + ac \not\equiv 3$ (mod 6) is true because I think congruent integers $b$ and $c$ multiplied by a same constant $a$ can only take an answer of 0, 1 and 2 in the equation $ab + ac$(mod 6).  Obviously, me thinking things is not very mathematical! Plus I have a strong feeling I'm just flat out wrong somewhere, any ideas or solutions towards proving this statement would be very much stuided and appreciated. :)


How ping to google server can exceed light speed?

when i try ping google server takes only 30ms.   PING google.com (172.217.26.174) 56(84) bytes of data. 64 bytes from google.com (172.217.26.174): icmp_seq=1 ttl=56 time=31.2 ms 64 bytes from google.com (172.217.26.174): icmp_seq=2 ttl=56 time=32.3 ms   I did this from cochin,Kerala,India to a google server located in california, US. The minimum distance from this two places is 14,560 km.  So, light can do this two way trip in just 97ms.  (14,560 * 2 ) / c =~ 97ms   So how pinging google server can exceed the light speed? What is wrong in the assumptions/calculations?  EDIT  Hi i have found similar question here,   But ping does not shows any cdn domain there, also iplocation of server belongs to the US. If server located nearby why ping is not showing the that nearby ip address?


I've recently added SSD to my storage drives count and would like to install new OS there, but as I understand if one drive already has boot sector on it, then another (Windows) installation will use same boot sector.  Now I don't know for sure what issues it may raise, so I'd like to prevent it, by disabling current active drive with boot sector.  I know for sure, that manually disabling power supply and SATA cable should help, but could it be done through BIOS, so that there would be no need to do it manually with help of hardware?


How to put something at the top of the \longrightarrow?

I would like to put something at the top of the \longrightarrow, something like \longrightarrow^{k\rightarrow\infty}. However, instead of putting k\rightarrow\infty on the top right corner, I would like to put it in the middle on the top of \longrightarrow. Could someone help me?


How many lights did Gul Madred show to Picard?

I have seen a few people discussing this, and I was wondering if anyone thought it was possible that in the Star Trek: The Next Generation episode, Chain of Command, the Cardassian interrogator Gul Madred had actually brought in a fifth light and that is why Picard said he saw five at the end of the episode? When Madred asks Picard for the last time, we can't see how many lights there actually are. I know the whole thing is supposed to be a reference to "1984" but TNG was clearly doing its own thing.


Where is actual standard for open-source C compilers (gcc, clang) that they implement?

I wanted to learn more about C and instead of getting a rehash in form of a book about C, I wanted to read the "Standard that compilers are actually implementing". This seems to be ISO/IEC 9899:2011 Document, currently available on their website for 198 CHF.   This bothered me, as after a quick search I realized that the "C11" standard seems to be not publicly available. Open-std.org lists only  as "...reflects what was to become the standard at the time of issue.", but not the actual standard.   Now my question:    Which Standard exactly are the open-source compilers (especially clang and gcc) implementing?  Where can I find this standard?   And in case open-source compilers implement a standard that is not publicly available:   Why exactly is a open-source compiler implementing a non-public standard? Does that not greatly prevent people from contributing code or fully understanding the code, which I think is the purpose of open-source. Given all the hours spend on coding and then giving away the code, surely some hours can be spend on writing a standard instead of code.


Is CAN I START correct ?  Is it okay to use it instead of Shall I Start ? For eg I want to start my presentation in front of class  So can I say CAN I START  Like I'm asking for permission to start my presentation. Asking Teacher for permission


How do you buy the right train ticket in the UK?

I recently traveled by train in the UK. I went to the station and bought a return ticket from Bristol to Oxford. The machine presented a huge number of options but in the end I chose a super off peak return as I was coming back the next day out of what I thought were peak times.  When I attempted to come back at 9:40 am I found that my ticket wasn't valid until 10:30am. I checked my ticket and there was nothing written on it about when it was valid and no times were shown on the machine I bought it from either.  How on earth can you tell which ticket you should have at what time of day?


RewriteBase in httpd.conf + RewriteRule in .htaccess?

RewriteBase is set in httpd.conf for an alias:  Alias /test /home/user/test <Directory "/home/user/test">     AllowOverride All     Allow from All      RewriteEngine On     RewriteBase /test     RewriteRule ^foo$ foo.html [QSA,L] </Directory>   This works fine:  is foo.html.  Now, I'd like to move the RewriteRule to .htaccess, because that's where it makes more sense. It's a configuration for the test project after all. However, if I do that, then RewriteBase is not interpreted any longer, and loading  fails.  Is there any way to set RewriteBase in httpd.conf plus RewriteRule in .htaccess?


Where are Crystal Pieces for the Dreams In Oblivion quest?

For the Falskaar quest Dreams in Oblivion, where are the four crystal pieces located?


So if I wrote:     You and I have a lot of places to go   is this wrong?  I was chatting to a friend on social media and he kept correcting me. 'You should' and 'I should' sound correct however 'me should' sounds wrong but no matter how hard I tried to explain from my side we got nowhere .


error: file '/grub/i386-pc/normal.mod' not found in ubuntu 13.10

I've installed ubuntu 13.10, but after rebooting I get the message:  GRUB loading: Welcome to GRUB!  error: file '/grub/i386-pc/normal.mod' not found Entering rescue mode... grub rescue>   I have the following partitons setup:  /dev/sdb5:  /boot  ext4   500MB /dev/sdb6:  swap            4GB /dev/sdb7:  /      ext4    60GB /dev/sdb1:         ntfs   900GB   I have already tried solution from "" and "" but did not get success.  I am using 1TB external HDD for this and don't want to mess the windows on /dev/sdaXY . i have acer travel mate with Intel i5 processor,4 GB RAM. I am using iso image of 64 bit ubuntu named "ubuntu-13.10-desktop-amd64.iso" .. Please help me, I have tried various solution but did not fix it for last 3 days.


public class Main {      public static void main(String[] args) {         generateRandomNumber();      }      public static void generateRandomNumber(){          double[] insideArray = new double[5];          for(int i=0; i<insideArray.length; i++) {             double value = (Math.random()+1)*10;             insideArray[i] = value;             String.format("%.2f", insideArray[i]);         }         System.out.println("Displaying random generated Array: " + Arrays.toString(insideArray));      }  }  I am trying to generate 5 random numbers and store to an Array.  And I would like to format decimals up to 2 numbers. I tried "String.format()" method but didn't work. Still I am getting double like: 10.xxxxxxxxxxx. How can I format it such as ex: 10.xx ?


I have GIS points (x, y data) for every minute over a landscape. If I load them up as a CSV into QGIS they all show up as points, which you would expect. However, what I would like to do is use these points to create a grid. In other words, each point is a corner of a 1x1 minute grid. How can I do this?


Whenever I try to kill the Devil I die (often when I try I end up passing him and then I can't hurt him because he is behind me).


Java Scanner Class - Unable to exit while loop

I am trying to create a simple Scanner test program which will exit once the user inputs "Quit".  I have the variable being output to console and it will output Quit but when I am trying to compare the variable to the raw string it doesn't see it as true.  public static void main(String[] args) {      String input;     Scanner sc;      System.out.println("Enter 'Quit' to exit.");      while (true) {         sc = new Scanner(System.in);         input = sc.nextLine();         if (input == "Quit") {             break;         }         System.out.println(input);     }      sc.close(); }


Proving periodic points of tent-map are dense in [0,1]

Let $T$ be the tent map defined by $$T = \begin{cases} 2x \quad \text{ if } x \le 1/2 \\ 2(1-x) \quad \text{ if } x \ge 1/2\end{cases}$$ I am trying to prove that the periodic points of $T$ are dense in the unit interval, $I = [0,1]$. I know that all asymptotically periodic orbits of $T$ are eventually periodic, given that all fixed points are sources. However, I'm struggling in going about solving this given the tools I have. For context, this problem is problem 3.7 in Alligood's text. I was thinking that showing there are infinitely many periodic orbits is sufficient, but I'm unsure. I'm trying to find a more rigorous proof but am at a loss.


Required funds for American traveling to UK to visit fiancée

I am looking to travel to the UK (Britain) to visit my fiancée. I have the passport and I am getting the funds for the visa and the trip. But I am not completely sure how much money I would need to actually be allowed in. I am looking to stay for about a month and a half to two months. I was already turned away at the door for not having enough funds with me, so I don't want to make that mistake again and waste another 1,800 for airfare only to get told I can't get in.  So please if someone could tell me at least the range of how much money I would need to get the Standard Visitors visa and to be able to get into the country. I will be staying with my fiancée the entire time, so I won't be needing funds for room and board and such.    What do I need to bring, both in documentation and in funds?


Where can I get support for Ubuntu 14.04?

I need help with my old Ubuntu server. I can't find any place or forum to ask questions about it. I only have these questions because I am trying to upgrade the server to the new version, so I can use this forum properly.  Should I upgrade my server to 16.04.6 on my own and then ask for help? Will this break my website?


Does there exist a matrix $\mathbf{A}\in\mathbb{R}^{3\times3}$ such that $\mathbf{A}^{2}=-\mathbf{I}$?

Is it possible for a matrix $\mathbf{A}\in\mathbb{R}^{3\times3}$,  $$\mathbf{A}^2=-\mathbf{I}$$  I know that It is possible for $2\times2$ matrix, but is it possible for $3\times3$ matrix ?


Does anyone know the word for a question asked with the intent to injure or insult?  I know there is term for it, but I can't find it anywhere.  It's driving me crazy.  Example:  Are you blind, or just stupid?    Oh, and it's not rhetorical.  There is a more specific term.  Edit:  It's not sarcasm.  There is an actual grammatical term to describe this sort of question.


If $a+1/a$ is an integer, then so is $a^t+1/a^t$ for $t\in\mathbb N$

I need to show if $a$ is in $\mathbb{R}$ but not equal to $0$, and $a+\dfrac{1}{a}$ is integer, $a^t+\dfrac{1}{a^t}$ is also an integer for all $t\in\mathbb N$. Can you provide me some hints please?


How does this fit in the "pass by value of refrences" in java?

In the code below why foo2 is null when printing its data at system.out.print?  public class Helper {     public void shadowCopy(Foo foo1, Foo foo2){         foo2 = foo1;     }      public static void main(String[] args) {         Helper h = new Helper();         Foo foo1 = new Foo(50);         Foo foo2= null;         h.shadowCopy(foo1, foo2);      System.out.println(foo2.data);// why  java.lang.NullPointerException?     }      public static class Foo {          public int data=0;         public Foo(int data){             this.data = data;         }     }  }


How to run update loop (w/ PDO) using the $_GET array without having to manually enter each text box name?

EDIT 24-Feb-2016: PDO Cannot accept table names or column names as bindedparameters    I am looking for a workaround for using a loop to enter data using the $_GET array, because I cannot bindthe column namebecause PDO requires that it is manually entered.   Additionally, if do not bind the variable, and just use the $keyvariable as is, it opens up security vulnerabilities.  How do I work around this without having to manually enter each statement?  My PHP Page submits a form to itself and runs the following code:  $d=new db(); //tried putting this inside the foreach loop but encountered the same issue if($_SERVER['REQUEST_METHOD']=='GET'){     foreach($_GET as $key=>$obj){          $d->query("update settings set :key=:obj where id='default'");         $d->bind(':key',$key);         $d->bind(':obj',$obj);         $d->execute();         echo "update settings set $key=$obj where id='default' <br>"; //for each loop works fine, each update statement is executable in sql without error     } }   In case you need a breakdown of the db Class:  class db {      private $stmt;     private $dbc;      public function __construct($dbname = null)     {         if ($dbname==null){$dbname='fake_db';}          $u = "root";         $p = "fake_password";         try {             $this->dbc = new PDO('mysql:host=127.0.0.1;dbname='.$dbname, $u, $p);             $this->dbc->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);         } catch (PDOException $e) {             $e->getMessage();         }     }      public function bind($param, $value, $type = NULL)     {         $this->stmt->bindParam($param, $value, $type);     }      public function rowCount()     {         return $this->stmt->rowCount();     }      public function lastInsertId()     {         return $this->dbc->lastInsertId();     }      public function beginTransaction()     {         return $this->dbc->beginTransaction();     }      public function rollBack()     {         return $this->dbc->rollBack();     }      public function endTransaction()     {         return $this->dbc->commit();     }      public function cancelTransaction()     {         return $this->dbc->rollBack();     }      public function debugDumpParams()     {         return $this->stmt->debugDumpParams();     }      public function run_query($query)     {         $this->stmt = $this->dbc->prepare($query);         $this->execute();     }      public function execute()     {         try {             return $this->stmt->execute();         } catch (PDOException $e) {             return $e->errorInfo;         }     } }


I'm generating images from a folder with this script:  $(document).ready(function() { $.ajax({     url: "gallery_images",     success: function(data){         $(data).find("a:contains(.jpg),a:contains(.gif),a:contains(.png)").each(function(){             // will loop through             var images = $(this).attr("href");              $('

').html('').appendTo('#galerija');         });     } });   });  The problem is that, then I'm trying to click the image, simple jQuery click event does not work.  $(".g_image img").click(function(){ alert("WORKING!");   });


Is there an easy way to attach source in Eclipse?

I'm a big fan of the way Visual Studio will give you the comment documentation / parameter names when completing code that you have written and ALSO code that you are referencing (various libraries/assemblies).  Is there an easy way to get inline javadoc/parameter names in Eclipse when doing code complete or hovering over methods? Via plugin? Via some setting? It's extremely annoying to use a lot of libraries (as happens often in Java) and then have to go to the website or local javadoc location to lookup information when you have it in the source jars right there!


def WhichAreCaps(Word):     for w in Word:         if w.isupper() == True:           print (w)  WhichAreCaps("IJkdLenMd")   Result:  I J L M   So I'm trying to build a code that finds Capitalized letters in a string and print out the letters. The problem is that I want the result to come out as one line of string, not four. Is there a way to do so? (I'm just a beginner;;)


How can one change an entire document to use bold font?

I see many posts in how to changes the font and font size, but none for changing the default font for a document to bold font. I believe this is called changing the font series. The approach in  (obtained by random Googling) looks like it should work, but doesn't do anything when I stick it in the preamble. Maybe I'm putting it in the wrong place.  \fontencoding{T1} \fontfamily{garamond} \fontseries{m} \fontshape{it} \fontsize{12}{15} \selectfont   There is also some discussion .


Best vehicle for each stage in Hill Climb Racing

In Hill Climb Racing we have several vehicles and several stages.  Different vehicles have different performances on the same stage, and I'd like to know what are the best combinations to maximize distance in each stage.    Also, what is the best combination of a vehicle and a stage to get lots of coins?


Is there a good  (free telnet / ssh client) equivalent for OS X?  I know that I can just use terminal and an ssh command, but I want some sort of application that will store connection info, passwords, logs, etc for me, much like PuTTY.  Does this exist?


Histogram bin size to show deviation from uniform distribution

Simple question:  Is there a rule of thumb for number of bins in a histogram with a uniform distribution?  Details:  I have a stochastic computer simulation that produces, as a test, $n$ values that should be uniformly distributed in a given interval, $[a, b]$. Due to the inherent random nature of the simulation, there is some noise.  I want to show (visually) that under certain circumstances there is additionally a deviation from this uniform distribution. The deviation happens at the lower boundary, up to $5$ to $15$% of the interval and manifests as less values (up to about $40$%) per bin as a uniform distribution would have.  At the moment $n=5\times10^6$, but I can increase that if necessary. To simplify the comparison between different cases that don't have the same $a$ and $b$ I scale to $[0, 1]$. This is standard practice in my field.  My idea is to use a histogram, but I've been trying to find a justifiable method to define the bin size (or number of bins) and failed so far. Most rules-of-thumb I found assume a normal distribution. Is there any that uses uniform distribution? It's bad to search for, because I only find discussion about uniform bin size, not uniform distribution.  The best rules I can find from  are: Freedman-Diaconis $\approx 160$ Doane-Rule $\approx 20$ The difference lies most likely in the skewness, which is very close to zero in my cases, or I simply used the formula wrong. It's  not that simple. What I did (in Python): k = 1 + numpy.log2(n) + numpy.log2(1 + abs(scipy.stats.skew(z, bias=False)) / np.sqrt(6 * (n - 2) / ((n + 1) * (n + 3))))  Purely subjectively I'd say that $20$ is far too few and $160$ is ok, but Freedman-Diaconis is built on the assumption of normal distributed values... This is an example with 160 bins. I want to show the difference between the black, blue and red line at the bottom for panels (3)-(5), which are not there for (1) and (2). I'm aware that connecting histogram values with a straight line is terrible from a mathematical standpoint, but there are extenuating circumstances that make this a little bit better (basically the values represent a concentration field, which is continuous).    Edit1: I forgot to mention: plotting the independent variable on the second axis is standard practice in my field, because it's the height. So the histogram is turned by $90°$ compared to the usual way.  Edit2: An example P-P-plot (the rightmost panel in the figure above), as suggested by whuber:  For me it is a lot harder to interpret, but that might be my problem, not true in general.  Edit3:  is different, because it (i) looks for an automated solution (which I don't) and (ii) it does not have an underlying (almost) uniform distribution.


Robot tank run amok, its trainer trapped in cave on the Moon

Another dim memory from my sci-fi reading binges in the 1980s... this one almost definitely in one of the big hardback collections full of late Golden Age short stories.  The story is told from the perspective of a robot (maybe cyborg?) tank that has stopped responding to control signals and is aggressively "defending" some portion of the Moon, to which it was previously assigned. Maybe a war had ended, or maybe it became confused about an exercise that it thought was real?  There was a person trapped in a cave trying to communicate with the tank. The tank mostly ignores him, so the main purpose of what he says is exposition for the reader. I think this person was an expert on this type of robot/cyborg sent to "talk it down", but the tank had attacked, and this guy was the only survivor. The expert was badly wounded -- I think he mentions his suit had to amputate his leg to seal a hole -- or maybe flood it with water which would freeze to seal the hole but mean that his leg had to be amputated later. He keeps trying to convince the tank to stand down, at one point saying that he knew it "back when it was just a two-wheeler an autocyber in boot camp" or something along that line. (Edit: I must have been reading too fast and/or distracted back then, since per the quote below I seem to have misread "motorcycle" for "autocyber"!)  One detail of the attack stands out -- the tank was low on ammunition, I think, so it used a kind of bomb with an electric/magnetic "catapult" (aka "magnapult") to hit the expert's transport. The tank was proud of itself for figuring out a way to hit it far out of the normal range by 1) using its own top speed to add velocity to the projectile, and 2) building up the catapult's energy past its normal operating range, which caused it pain but made the bomb go much further. It catches the transport by surprise, since they thought they were safely out of range of the armaments it had left.  The premise sounds a lot like a Keith Laumer "Bolo" story, but I'm fairly sure that it's not actually one of them. It had a somewhat grimmer feel to it. I could be wrong, though, since it's been 30 years.


Installing lubuntu-desktop on Ubuntu 19.04?

I'm wondering, what is the reccomended way to install LXDE alongside Ubuntu 19.04, while getting the full "Lubuntu" experience? I tried running the following command:  >$ sudo apt install lubuntu-desktop  ... Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help resolve the situation:  The following packages have unmet dependencies:  lubuntu-desktop : Depends: ubuntu-release-upgrader-qt but it is not going to be installed                    Recommends: plasma-discover but it is not going to be installed E: Unable to correct problems, you have held broken packages.   I know I can do sudo apt install lxde, but does that give everything that lubuntu-desktop has? Or will it just be a stripped-down default LXDE installation?  I tried doing and apt update and dist-upgrade, but it made no change.


How to test out Windows 7 applications to see if you like them?

When a portable version of a Windows 7 application is not available, what is an effective way to test it out to see if you like it?  I define effective as:   Not time consuming Leaves no (or minimal) files and folders behind if uninstalled Leaves no (or minimal) registry entries changed or added if uninstalled Does not remove files or registry entries that were present before evaluating the application   I used to take a registry and file structure snapshot before and after trying out any application, and then compare everything after the install or uninstall.  This did not satisfy #1 above, and required many judgement calls, especially for registry entries.  I then switched to creating System Restore points.  But I'm always concerned they will mess something up.  And after installing the (disappointing and misleading) free version of Microsoft OneNote 2013, and then removing it by restoring a System Restore point, there was still a significant amount of cleanup that had to be performed by hand (as well as a bunch of new \Windows\assembly folders that I'm really not sure if I should delete).  I would prefer a free (as in no cost) solution.  The solution can use tools built into Windows 7 or not.  The solution must be legal, and must work on a system on which the Windows 7 operating system was pre-installed by the manufacturer (no Windows installation disks included).  If the answer includes setting up a VM, please ensure that it will work with this condition.  Technically, if the answers others post use tools and techniques that are built into the OS, then this question belongs here in the Superuser site, and if the answers use tools that are not built into the OS, then this question belongs on the Software Recommendations SE site.  Since there will likely be complaints if it is crossposted, and I can't predict the answers, I'll post the above question here.  If the mods want to crosspost it, they have my permission to do so.


I am reading a book on android development and it has a following example      for               (String brand:brandlist)       {           brandsFormatted.append(brand).append('\n');        }   This is the .java code for the application.  Can anyone please explain me what happens in the for loop? I did not understand I am a beginner and I tried searching on the internet but did not understand this particular part.  Can anyone help me please? Thank you


Using level information from OpenStreetMap to show roads / tunnels / bridges in right level?

OSM has information about the levels of road segments for example road crossing railway.   It is possible to order layers dynamically from the level attribute?   I only found one possibility in QGIS to order layers, but they are fixed and only manually set.


how can I use a variable in match() if I want to use regex? This works fine for me:  if (message.match('!' + cmd)) {   this.client.say(to, myJson[cmd]); }   but if I try something like this it will not check the variable.      if (message.match(/!cmd/i)) {       this.client.say(to, myJson[cmd]);     }   I already searched for a solution but could only find something for replace.  Edit: it's not a duplicate of  as it explains it for replace not match.