Pass the value of a variable to a function in Javascript

I want to write a simple HTML file containing 10 buttons, each button with text from 0 to 9, and when a button is clicked it shows on the console the number corresponding to it. The buttons have to be dynamically created in a javascript file.  Here is my code:  HTML file:  <!DOCTYPE HTML>

     Javascript (test.js) file:  $(document).ready(function () {     DOM_ready(); });  function DOM_ready() {     var maindiv = document.getElementById("maindiv");     var button_create_aux;     for (var i = 0; i < 10; i++) {         button_create_aux = document.createElement('button');         button_create_aux.innerHTML = i; // sets the button text corresponding to its iteration value.          $(button_create_aux).click(function () {             clicked(i);         });          maindiv.appendChild(button_create_aux);     } }  function clicked(num) {     console.log(num); }   The problem is that when I click the buttons in the HTML page, it shows always on the console the last value given to the variable i used in the for loop (in this case, 10).  It looks like that in the line clicked(i); the argument passed is the reference to the variable i, not its value, so I want a way to pass the value that i has at each iteration of the loop.


Include the whole package or only the specific class?

In my program i have to use sort function of the Collections class. Is that compile time remains same in both the cases?   Case 1: include import java.util.Collections; Case 2: import java.util.*;   What I thought is that the second case is gonna take long time to search for the Collections class, if there are other import packages.  Please correct me if am wrong.


How to use Google Location History to geotag photos?

Google know where we are 24/7. If my camera does not have built-in GPS, but I would like to geotag my photos, is it possible to use the location history to automatically tag photos with my GPS coordinates at the time they were taken? If so, how?  I am not asking  with which to tag photos.


Is there a document that lists all CSS properties that make sense for individual HTML tags?

We have documents that describe all HTML tags. We have documents that describe all CSS properties. However, I have failed to find a document that would exhaustively declare which CSS properties influence rendering of which HTML tags. Does such document exist? For example, is there a document that states that rendering of hr tag depends on the value of the margin-top CSS property?


visas and baggage for overnight layover in Miami when travelling from Spain to Colombia

My 9 year old son and I have British passports, and my husband Spanish. We have a 19 hour layover in Miami when flying from Madrid to Colombia, and intend to leave the airport and stay overnight in a hotel preferably just with our hand baggage. First question: do we need any kind of visa before we fly, and indeed are we allowed out of the airport (sure hope so...!). Second, will luggage be checked all the way through to Colombia or will we need to recheck? (Flying with American Airlines). We hope to do a quick trip to South Beach to check it out! Thanks!


When I write a multi-page paper with imported images, I usually try to group the picture with the text referencing it.  Sometimes, there is not enough room at the end of the page for the picture, and the picture is moved to the top of the next page.  This often leaves some white space at the end of the previous page.  In order to remove the white space, LaTeX automatically fills the space with text that is meant to come after the image.  Is there a way to prevent this?


Is there a way to get the host of an SSH request in an SSH server?

I'm writing a custom SSH server. Whenever I connect to it via ssh user@subdomain.example.com, I need to know the value of the subdomain.  Right now I can only get remote and local IP addresses.


Is there a contraction for "I was"?    There are contractions for "I am" (I'm), "I will" (I'll), "I have" (I've), "I would" (I'd), and yet the simple past tense seems conspicuously missing. Why is that? Does that reasoning apply to "I did" and "I had" as well?


Moving a shape around the earth while maintaining the proper projection

What is the transformation needed to be taken on every data point of a shape to  rotate that shape around the globe.  I'm trying to figure out the math behind this kind of transformation so I can create something similar to this using leaflet and d3   Edit: To be clear, I am looking to achieve this using leaflet, D3, and javascript not desktop GIS software. My end product will a function that takes a point (lat,lng) shifts it by an amount (shift_lat,shift_lng) and returns (new_lat,new_lng)


Will a pooled coefficient be bounded by the coefficients from the group regressions?

Consider the linear regression model,  $y = \beta_0 + \beta_1x_1 + \beta_2x_2 + u, u \sim N(0, \sigma^2 )$  If we estimate the model twice using OLS on two mutually exclusive groups (say, group 1 and group 2) and then estimate the same model using the pooled sample of group 1 and group 2, should the $\hat{\beta_1}$ from the pooled regression be bounded by the $\hat{\beta_1}$'s we obtain by estimating the model on each group separately?  My intuition tells me no, but any form of proof/evidence is eluding me.  Thanks in advance for any help.


I have a new laptop with SSD + HDD. I already managed to set up a dual boot with Windows 10 preinstalled and Ubuntu 17.10.  Ubuntu root, home and swap directories are all on the SSD. In addition I took 500GB from the HDD and created a partition for my data (I called it /mnt).   Now I want to make the operating system store music, downloads, documents, pictures and videos on the HDD data partition, while maintaining /home on the SSD.   I know it has to do with fstab, so I found the file and a way to edit it, but what am I supposed to do now? The general information is not clear enough for me.   Here is my fstab:   # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # #                 # / was on /dev/sdb6 during installation UUID=cbdf87b9-ddf0-4242-a6b3-12ea1f13c653 /               ext4    errors=remount-ro 0       1 # /boot/efi was on /dev/sdb1 during installation UUID=7E53-EFDB  /boot/efi       vfat    umask=0077      0       1 # /home was on /dev/sdb7 during installation UUID=a78d2329-659f-4d6e-a7e3-c54f08dc5bdb /home           ext4    defaults        0       2 # /mnt was on /dev/sda2 during installation UUID=193e6f14-a677-4f3e-9373-06f6d12c12f0 /mnt            ext4    defaults        0       2 # swap was on /dev/sdb5 during installation UUID=e8fe7608-591e-40b2-ab28-603b058c87f9 none            swap    sw              0       0  Can someone guide me step by step?


(How) should I report someone abusing data from Stack Exchange for spam?

Disclaimer: the email below has turned out to be from the person signed below it  The general question in title still stands.  So I got this spam from Gmail address address removed since it turned to be legitimate personal gmail address (just remove stars to get valid address):     Hi Tomáš,      Yes, I’m afraid it’s true; I am another recruiter to add to the long   list of recruiters who must be contacting you almost daily.      At least some good news is that I am a direct employer and not one of   those pesky Recruitment Consultants from an Agency….      I don’t want to waste your time, I’m not going to harass you, I’d just   like to know one thing….      If you were considering a change in company, what would the change   involve? What would be important to you? And, what would you want to   hear from me in order to make you consider a new company?      Ok, I’m obviously not very good at this! That was 3 things; I hope you   can forgive me for that!      If you do reply and I think I can match what your needs and   motivations are, then perhaps you’ll be happy to have a conversation   with me about opportunities at Foxconn DRC in Prague……..      Kind regards      Paul      Paul Myers pmyers@foxconn.cz   phone: 420 466056626   Since the From field of the email didn't match the mail address in signature, I came to conclusion that the email is fake, presumably recruiter scam of some sort.  It is only on Stack Exchange where I come under name Tomáš Zato, which is actually Czech wordplay. So it is possible that someone farmed some data off Stack Exchange. I do not know if anyone bothers dealing with this kind of spam. But I found it notable because I receive very little emails and this one got through filters. Given that it's expecting reply, it could be dangerous scam.  I am not asking just about this message. How can I handle this in general? It's clear that my Stack Exchange username is related to the spam. And Foxconn is a real engineering company. (I have sent them the email in case they were interested)


I have an old laptop with Core Duo (not Core 2).  The CPU supports VT-x but the bios doesn't. (And never, no more BIOS update)  Does VT-x really need BIOS support? Can we do it with a Linux kernel patch?


What advantages does Blender Render have? I personally always use Cycles Render, because I think the rendered material looks more realistic and node shaders are easier to use.


how to start writing a very simple programming language

Recently, I was going around looking for ideas on what I can build using C this summer and I came across this post:      Implement a programming language. This   doesn't have to be terribly hard - I   did the language that must not be   named - but it will force you to learn   a lot of the important parts of C. If   you don't want to write a lexer and/or   parser yourself, you can use lex/flex   and yacc/bison, but if you plan on   that you might want to start with a   somewhat smaller project.   I was kinda intrigued about the implementing a programming language answer and I'm wondering how do I go about starting this? I've gone through the whole K&R book and I've done some of the exercises as well. I also have a bit of experience in C++ and Java if that matters. Any tips? Thanks!


How Diffie-Hellman authentication works?

There are a lot of good videos on a simple Diffie-Hellman in the internet but unfortunately that is susceptible to the MITM attack. I understand how with DH  the two parties are able to calculate a shared secret (shared private key?)  So now i am trying to understand the authenticated version, which should be safe from the MITM attack. Unfortunately i have not found a simple explanation to how it should work.   As I understand it requires the use of some certificates (pre existing keys?). Having some pre existing keys does not make a lot of sense to me, since the whole purpose of DH is key exchange. And vice versa: If i can just generate a private and public key for both parties and transfer the public keys than why do i need DH at all? Is an entirely secure method available to establish a connection between the two parties who don't have some preexisting knowledge of each other (by using authenticated DH)? If so then how does the authentication scheme work?


How to fix windows bootloader after grub install?

Ok, so that's what I did: I installed ubuntu and when I had to chose the partitions and grub install I clicked on overwrite "windows bootloader" or something like that, now everytime I boot, grub shows ubuntu and windows, ubuntu works but if I choose windows grub send me back to itself. It's like the windows bootloader loads... grub. How can I fix that?  parted /dev/sda print Model: ATA WDC WD3200BEVT-7 (scsi) Disk /dev/sda: 320GB Sector size (logical/physical): 512B/512B Partition Table: msdos   Number  Start   End     Size    Type      File system     Flags  1      32.3kB  82.3MB  82.2MB  primary   fat16           diag  2      82.8MB  10.8GB  10.7GB  primary   ext4  3      10.8GB  317GB   307GB   primary   ntfs            boot  4      317GB   320GB   2683MB  extended                  lba  5      317GB   320GB   2683MB  logical   linux-swap(v1)   Windows part of my grub.cfg   ### BEGIN /etc/grub.d/30_os-prober ### menuentry "Windows 7 (loader) (on /dev/sda3)" --class windows --class os {     insmod part_msdos     insmod ntfs     set root='(hd0,msdos3)'     search --no-floppy --fs-uuid --set=root 7AF84223F841DE4F     chainloader +1 }


Why didn't Aragorn keep going with the army of the dead?

Why did Aragorn not keep going with the army of the dead and overthrow Mordor and Sauron?  As unstoppable as they seem to be in destroying all physical armies without any injuries, taking on Mordor itself wouldn't be an issue. Thus clearing the way for Frodo to destroy the ring and Sauron, or even destroy Sauron himself.  In the battle of Dagorlad, the Alliance surrounded Barad-dûr, until Sauron has shown himself which means that Mordor could be taken by an army's might (if Sauron was an issue).  Considering that Sauron was far more powerful in the Second Age, he has only been lessened as a spirit once he possessed the ring of power, and he had far more powerful servants.


I downloaded the files through this website onto my flashdrive and am wondering how to boot it up?


Failed to fetch -- apt-get update, “Temporary failure resolving …” & unable to locate package ERROR

Good day, NOTE: I'm running Ubuntu 20.10 on VM Box I get the following error: apt-get update fails to fetch files, “Temporary failure resolving …” error. I tried literally every "fix" I can per this user group and others on the net.  I still have the same error. help please;


How do I move my family to my new house?

I'm playing Skyrim with Hearthfire and I'm wondering how do I move my family(Wife and Daughter) to my new Manor near Morthal?


Partitoning to install Ubuntu but already have 4 main partitions

I want to install Ubuntu alongside of Windows, but there's a 4 primary partitions limit. So there's:  BIOS_RVY (10GB)  System (100MB) (Windows)  (C:) Windows  (D:) Data  I'm not sure what to do in this situation. This is my girlfriend's laptop and she doesn't want to remove MSI's pre-installed recovery partition, even though I'm pretty sure she's never used it. What is it exactly? Also, does Grub render Windows's "System" partition redundant?


I am new to writing SQL scripts (at least anything more than SELECT * FROM X). I have run into a problem grouping a table by one value, and then joining values from another column into a single string.  I would like to perform a group by on a temp table, and then concatenate values of a column in the group together.   The table variable (edit), @categoriesToAdd, data structure is [SubscriberId int, CategoryId int].   What I am trying to do is something like (My understanding is that CONCAT is the bit missing from MSSQL):   SELECT SubscriberId,         CONCAT(CONVERT(VARCHAR(10), CategoryId) + ', ') as categoriesAdded FROM   @categoriesToAdd GROUP BY SubscriberId   The concatenated category IDs for each subscriber would then look something like: 0001, 0002, 0003, 0004  Thanks!


How to deal with categorical variables in a clustering problem?

I have a dataset with the following variables (among ohter variables) that represents custome card transactions and I'm trying to cluster the clusters using k-means.  GENDER_M: can be 0, 1 or NA GENDER_F: can be 0, 1 or NA   I'm trying K-means using R packages NbClust and cluster  Now, on  I wrote that hot encoding these variables didn't work out very well. I tried:  GENDER_M0: 1 for all the records that contain 0 in column GENDER_M - 0 otherwise GENDER_M1: 1 for all the records that contain 1 in column GENDER_M - 0 otherwise GENDER_MNA: idem GENDER_F0: idem GENDER_F1: idem GENDER_FNA: idem   So, in total, I have 5 possible combinations:  NA/NA 0/0 0/1 1/0 1/1   1 means that there's a presence of the respective gender in the buying patters of the customer. For example, if a customer buys razors repeatedly, he will get a 1 in column GENDER_M.  Can anyone advise on a good method to deal with categorical variables in a clustering problem?  Thanks


Where does this formula for normal ordering in QFT come from?

On  you can find the following equation for free fields $$:\phi(x)\chi(y):=\phi(x)\chi(y)-\langle0| \phi(x)\chi(y)|0\rangle\tag{1}$$ But I don't understand where this comes from while it seems a very fundamental equation. I tried understanding it by switching the terms: $$\langle0| \phi(x)\chi(y)|0\rangle=\phi(x)\chi(y)-:\phi(x)\chi(y):\tag{2}$$ Then the following makes sense: you can expand $\phi,\chi$ in terms of creation/annihilation operators. The expectation value of a normal ordered product is zero so it makes sense that by subtracting it on the RHS the normal ordering term doesn't contribute. For example $$\langle0|a a^\dagger|0\rangle=a a^\dagger-:aa^\dagger:=(a^\dagger a+1)-a^\dagger a=1\tag{3}$$ What doesn't make sense is that $\phi,\chi$ are generally complex sums of creation/annihilation operators so after applying Wick's theorem I would expect there would be many more terms in the RHS of the second equation. So my question is why does this equation have this form? I feel like understanding this equation would really help my understanding of QFT so any help is appreciated.


Let $X$ be a random variable that follows $Uniform(-1,2)$ distribution.   Then what will be the cdf of $X^2$?   What i did was $$P(X^2\le y)=P(X\le y^{0.5})= \int_{-1}^{y^{0.5}}(1/3)dx=(1/3)(y^{0.5}+1) $$ $0\lt y \lt 4$ But this cdf doesnt give the probability $0$ at $y=0$ also the pdf which i get doesn't integrate to 1 What is wrong can somebody explain?? Am i doing something wrong??


I expect to be downvoted to hell but I'm having trouble finding the answer to this  I'm trying to write: <a href="url">  but clearly you can't see that because i can't escape it  I see now that it's backticks thanks anthony


Position all selected vertices to the same place

Can I position all selected vertices to the same place?   I basically want to set all of their x positions to 0.


I've looked everywhere and cannot seem to figure this out. My issue is that I am trying to use the 'enum' for rank that is in my database but keep getting errors.  What I have below I'd like to be able to display in a specific div depending on what rank a member is.  This is what I have so far, where am I going wrong?  If someone could shed some light on if this is even correct or what I need to do to make this work, I'd greatly appreciate it.  PHP:  class Rank {   // If no value is given during object construction this value is used   const __default = 1;   // Our enum values   const Registered       = 1;   const Legend           = 2;   const Inactive         = 3;   const Greenhorn        = 4;   const FullMember       = 5;   const JuniorAdmin      = 6;   const SeniorAdmin      = 7;   const Leader           = 8;   const Founder          = 9;   const OriginalFounder  = 10; }  $registered     = new Rank(Rank::REGISTERED); $legend         = new Rank(Rank::LEGEND); $inactive           = new Rank(Rank::INACTIVE); $greenhorn          = new Rank(Rank::GREENHORN); $fullmember     = new Rank(Rank::FULLMEMBER); $junioradmin        = new Rank(Rank::JUNIORADMIN); $senioradmin        = new Rank(Rank::SENIORADMIN); $leader         = new Rank(Rank::LEADER); $founder            = new Rank(Rank::FOUNDER); $originalfounder    = new Rank(Rank::ORIGINALFOUNDER); $fail              = 1;  function responsibilities(Rank $rank) {   if (Rank::REGISTERED == $rank) {     echo "Post something about being a registered member.\n";   } elseif (Rank::LEGEND == $rank) {     echo "Post something about being Legend.\n";   } elseif (Rank::INACTIVE == $rank) {     echo "Post something about being Inactive./n";   } elseif (Rank::GREENHORN == $rank) {     echo "Post something about being a Greenhorn./n";   } elseif (Rank::FULLMEMBER == $rank) {     echo "Post something about being a Full Member./n";   } elseif (Rank::JUNIORADMIN == $rank) {     echo "Post something about being a Junior Admin./n";   } elseif (Rank::SENIORADMIN == $rank) {     echo "Post something about being a Senior Admin./n";   } elseif (Rank::LEADER == $rank) {     echo "Post something about being a Leader./n";   } elseif (Rank::FOUNDER == $rank) {     echo "Post something about being a Founder./n";   } elseif (Rank::ORIGINALFOUNDER == $rank) {     echo "Post something about being an Original Founder./n";   } }  responsibilities($registered); responsibilities($legend); responsibilities($inactive); responsibilities($greenhorn); responsibilities($fullmember); responsibilities($junioradmin); responsibilities($senioradmin); responsibilities($leader); responsibilities($founder); responsibilities($originalfounder);  responsibilities($fail);   HTML:
<?php echo $rank ?>


Infinitely many primes for quadratic residues

Let $a \in \mathbb{N}.$ Prove there are infinitely many primes $p$ satisfying $$\left(\frac{a}{p}\right) =1.$$  Remark: One may need to use the Dirichlet theorem, which states that if $a,m$ are coprime then there exists infinitely many primes $p$ such that $p \equiv a \pmod{m}.$


Enable/Disable sidebar in Nautilus (aka Files)

I'm on Ubuntu 14.04 LTS and would like to set the Files (Nautilus) sidebar (where it shows Places, Devices, Network) to default to not being displayed.   It can be toggled on/off with F9. In preferences you can set hidden files to display or not, but there's no option to set the sidebar to not display by default.


How do I calculate encounter difficulty for PCs with allied monsters?

I'm currently running a mega dungeon in 5e D&D, and my players have recruited some monsters into their service. I have been building encounters using the dungeon masters guide rules (pg. 81-84), but these only account for groups of player characters. How should I recalculate the encounter difficulties that I have planned when they also have some recruited monsters with them?   Options I have considered are shifting the encounter multiplier  (pg. 82) according to the party size paragraph (pg. 83), but this fails to account for the inherent weakness of the recruited MOBs,   Alternatively, I could maybe add the modified experience total of the group of MOBs to the parties XP thresholds, as modified XP is probably a fairly accurate guage of additional party ability (probably without including them in the party size)  If anyone has done this before, knowing what worked would be nice, otherwise I'll use my best judgement and comment later on how well it worked out


Derivative of sin(x)/x at $0$ by definition of derivative

the question I am attempting is:  Show $f '(0) = 0$ for:  $$f(x) = \left\{ \begin{array}{lr} \frac{\sin(x)}{x} & : x \neq 0\\ 1 & : x=0 \end{array}  \right.$$  So I got stuck after the following working:  $$ f'(0)  =  \lim_{h \to 0} \frac{f(0+h) - f(0)}{h} \\  = \lim_{h \to 0} \frac{\frac{\sin(h)}{h}-\frac{\sin(0)}{0}}{h}\\ = \lim_{h \to 0} \frac{\sin(h)}{h^2} $$ and the above limit does not exist. Am I not applying the derivative definition right? or am I going wrong somewhere else?   EDIT:  I now see that f(0) = 1 from the definition of the function, however I still have: $$\lim_{h \to 0}\frac{\sin(h)-h}{h^2}$$ which I am struggling to evaluate. Splitting into two fractions the first fraction is still the one from above which does not exist.  Also this must be from definition of derivative directly and not by L'Hopitals rule as it has not been taught yet.


Easy way of proving continuity of a convex function

Is there an easy and fast way to prove that a convex function $f : I \to \mathbb{R}, \, I \subset \mathbb{R}$ an interval, is continuous? All the proofs that I know are very long and technical. Thanks in advance for any answer!


What do we call the person who gives a beggar money?

A beggar is a person who beg for getting money or something from a person but what do we call that person who gives the beggar the money ? Like Hop-ons are people who jump onto the back of the stair car for a free ride. In the question, I mean people who gives money not always or gives money in an irregular form, like not giving donation at a particular time/date or day.


What does really attracts a water stream to a charged object?

I saw  by  and I was not 100% sure about the third phenomena, a statically charged object attracting a stream of water, especially because he explicitly mentioned that it is not due to the  of the water. A week later he uploaded an  all five phenomena and he says it is because of repelled equally charged ions, back up the water flow, such that the water actually falling along the charged object would be oppositely charged and therefore attracted. Here is a still image from the video illustrating this:    However this explanation seems strange to me, since this would mean that this way you could build up a charge in the water which has exited the tap (as well as in the water inside the tap as well). Therefore it should get harder to push those ions back over time, and therefore there also would be a decrease in the attraction of the water (assuming there is no other way to discharge it). I have tried a simple similar experiment, where I catched the water leaving the tap in an insulated bowl, but I did not notice a decrease in attraction.  There a couple of reasons why my experiment does not rule out his theory:   I was holding the charged (plastic) object by hand, which caused that its distance to the water stream varied, making it difficult to observe a decrease in attraction. I only conducted my experiment for roughly 30 seconds, which might be enough time for a opposite charge to build up.   The reason that he mentioned why permittivity can't cause this phenomena is because the electric field would be homogeneous and therefore the attractive and repulsive force of both dipoles of a water molecule would cancel out. However the electric field would only be homogeneous if the charged object would be an infinitely large plate, which it isn't. Thus water molecules would be attracted to the charged object. In order to make the permittivity theory more plausible I thought of maybe doing a order of magnitude calculation to see if it could generate a large enough force would be able the water stream by the observed amount. However I do not know what a good guess would be for variables such as the amount charge on the charged object and how the electric field would fall off over distance.   So, my question is whether his theory is really correct, or if the permittivity of the water can cause it.


JQuery set  index from the value of attribute

I this select box :  <select id="owner_select">   <option value="1">Hasan</option>   <option value="5">aUser1</option>   <option value="7">aUser2</option>   <option value="8">aUser3</option> </select>   I want to make an option selected, but I want it to be according the ID of the user in this list not the index, so I set the value of each option to the user ID.  How could I make one this options selected when I know just the ID, for example I got ID=5 so I want aUser1 to be selected.


Existence of Electric field around a current carrying conductor?

A magnetic field could not be induced unless there is a time varying electric flux associated with the amperial loop under consideration. But a well known field exists around a current carrying conductor. Then how can we say that electric field is absent around the conductor.


My Database is currently configured in a utf8 format and I am trying to export my database into a spreadsheet using PHP. I am using this spread sheet to import data into google analytics.  Though every time I try to import the code it gives me this error  "Invalid characters in the file. Only UTF-8 encoded characters are supported."  Any insight or a better way to export a mysql db to a csv utf8 format is what I am looking for.  This is the code I am using.    function CreateCSV(){   require_once("/var/www/html/config/DBConn.php");     $select = "SELECT OrderID,Browser,Cookies,GaCampaign,GaContent,GaMedium,GaReferurl,GaSource,GaTerm,Gclid,IpAddress,GID,JavascriptEnabled,Mobile,OS,Pluginlist,ScreenDimension,Timestamp,UserId FROM OnlineSales ORDER BY OrderID DESC CHARACTER SET utf8";    $export = mysql_query ( $select ) or die ( "Sql error : " . mysql_error( ) );    $fields = mysql_num_fields ( $export );    for ( $i = 0; $i < $fields; $i++ )   {          $header .= mysql_field_name( $export , $i ) . "\t";   }   $header= "ga:dimension1   ga:dimension12  ga:dimension17  ga:dimension10  ga:dimension9   ga:dimension7   ga:dimension11  ga:dimension6   ga:dimension8   ga:dimension5   ga:dimension3   ga:dimension4   ga:dimension16  ga:dimension14  ga:dimension13  ga:dimension18  ga:dimension15  ga:dimension19  ga:dimension2";   while( $row = mysql_fetch_row( $export ) )   {       $line = '';       foreach( $row as $value )       {                                                       if ( ( !isset( $value ) ) || ( $value == "" ) )           {               $value = "\t";           }           else           {               $value = str_replace( '"' , '""' , $value );               $value = '"' . $value . '"' . "\t";           }           $line .= $value;       }       $data .= trim( $line ) . "\n";   }   $data = str_replace( "\r" , "" , $data );    if ( $data == "" )   {       $data = "\n(0) Records Found!\n";                           }     $date = new DateTime();    header ( 'Content-Type: application/vnd.ms-excel') ;   header("Content-Disposition: attachment; filename=Export".$date->format('m-d-Y_H-i-s').".csv");   header("Pragma: no-cache");   header("Expires: 0");   print "$header\n$data";    }     CreateCSV();


I would like to use the following PHP page in a PHP template. From what I've read I  need to include the Post ID but I don't know how to do so. My code is below      <?php            $postid = get_the_ID();              if( have_rows('repeat_field', $postid ) ) :             $i = 0;                // loop through the rows of data                 while ( have_rows('repeat_field', $postid ) ) : the_row();                  $i++;                      // display a sub field value                if (!empty(get_sub_field('feature_image_post', $postid ))) {                    echo '';                     echo '
';               }                   if( $i >= 200 )                 {                   break;                 }                   endwhile;              else :                  // no rows found              endif;              ?>


how to replace non english (a-z) characters to closest character resemblance

let say I have words in non-english language like  Tomáš  Babätká  Vôľa  and I want to replace the non-english/no-standard characters (don't know how to call them) to closest resemblance in english language so I would get:  Tomas  Babatka  Vola  so for áǎä I would translate them to a and óôö => o is there any Ruby gem (or maybe directly in Ruby lang)  how to map non a-z characters to closest resembling character? Or is the only option for me to write entire mapping  myself ? These characters  are usually used in non-english languages to represent pronunciation like in Czech or Slovak language.  but not characters like in Arabic, Chinese, Japanese or azbuka set  Reason why I need it: e.g. I want to be able to generate pretty urls like


How to cancel purple stage lighting on subjects?

HI! So, I shot a live band that played under purple stage lights. Most acts have strong colored LED lights affecting the subject's skin and I'd like to know how to tone these colors down when I'm shooting.   Ex: How to counteract the strong purple light shown on my subjects' faces? I'm aiming for as realistic color as possible.   I toggled between different White Balance settings and Picture Styles to go for a whiter picture overall.   1:    Pictures show different settings but all come out either too purple or too pink.  **I want to control these settings and get the best image quality as possible before even touching or relying on post editing.  Thank you!


How many trees over ${1,2,3,...n}$ with conditions

I’m stuck on this question in graph theory. The question is:  How many labeled trees are there over $V={0,1,2,...n}$ with which vertices 1,2,3 are leaves, and distance between any two of these leaves is 3 or more.  I tried using Cayley theorem but I don’t know how to apply it in this specific question.


Python copy file from script directory to current directory

I have some pre-made files that is kept in the same directory as the python script, I want to copy those into the target directory when I run the script.   I don't want to hardcode the path, especially if the script folder is moved to around. How do you get the script's directory path?  import shutil import os  file_name = "example.txt" source_file = '/'.join([this_should_be_script_directory, file_name]) current_dir = '/'.join([os.getcwd(), file_name])  shutil.copy(source_file, current_dir)


If else statement involving two numbers in scientific notation

I have two numbers in scientific notation and I want to do some comparison between them in an if statement in bash. While doing so, I am getting error like bwlow: E.g:  bash-4.2$ a=10e-12 bash-4.2$ b=12e-12 bash-4.2$ if (( a > b )); then r=1; else r=0; fi bash: ((: 10e: value too great for base (error token is "10e")   The same problem doesn't arise if a and b are integers. I see problem with floating numbers to if I use the above statement. Is there a simple way by which I can do the comparison within if statement?


"./configure: command not found" error when trying to install the JRE

I was trying to install JRE on my 64-bit ubuntu 10.04 installation.  Just to be sure that that is what I really want, I need to run a .jar file.  I downloaded java from this .  Then I chose linux x64 and downloaded the tar file, I extracted it and tried to compile the source code but had the error.  I don't know whether I downloaded the wrong file or I ran the wrong commands in the terminal  After I changed directory using the cd command to the extracted directory, I tried  ./configure    but I got this error:  ./configure: command not found     I know that there is an easier way to install java but I just want to understand how to install an application from source in linux as it seems that I will face this problem in the future.  Thanks in advance


How does Pearson's Chi Squared Statistic approximate a Chi Squared Distribution

So if Pearson's Chi Squared Statistic is given for a $1 \times N$ table, then its form is:  $$\sum_{i=1}^n\frac{(O_i - E_i)^2}{E_i}$$  Then this approximates $\chi_{n-1}^2$, the Chi-Squared Distribution with $n-1$ degrees of freedom, as the sample size $N$ gets larger.    What I don't understand is how this asymptotic approximation works. I feel like the $E_i$'s in the denominators should be replaced with $\frac{s_i^2}{n_i}$.  Since that would give you $\chi_n^2 = \sum_{i=1}^nZ_i^2$, for $Z_i\sim n(0,1)$.  But of course this has $n$ degrees of freedom, not $n-1$, so clearly something else is going on.


How to run installed ubuntu inside of installed windows

I have installed Ubuntu 14.04/Windows 8.1. I want to play couple rounds of some game in between tasks which I develop in Ubuntu. Games are running on windows, so each time I need to reboot, but it consumes too many operations.  Is there any way to load installed Ubuntu while in Windows? Any ideas or directions?  Thanks!  I already had some discussion on  which considered as offtopic (hi Cap)


What questions should I ask a PI in a PhD interview?

I am going to attend my PhD interview online. The PI asked me to present my previous work and a research proposal in 10 min. I made a 8 slide presentation. Is it very big for 10 min?  And the other thing he told me is, at the end he is going to give me some time so that I can ask questions. What kind of question should I ask in this case? Related to subject? What other areas (other than subject) should I consider to ask questions?


how to set differents baseline for a text part in a table with css

I wish to get something like that:    I have done many things, like changing Padding or line-height or even margin does nothing  "ROCKY" and "IV" are not on differents base lines...  Is it impossible to do ?  [edit] If it is possible to do a similar thing, without using an HTML table, I am a taker, even if it will force me to change a lot of things on my interface.    table {       position: absolute;       top: 50%;       left: 50%;       transform: translateX(-50%) translateY(-50%);       text-align: center;       background: #FFA500;       border: 1px solid #999;       padding: 10px;       box-shadow: 0 0 5px 3px #ccc;     }     thead {       font-size: 40px;       height: 100px;     }     thead td {       white-space: nowrap;       padding: 20px 10px;     }     span {       font-size: 80px;       font-weight: bold;       padding-top: 40px     }

                ROCKY IV


Finding all real valued functions that satisfy $f(f(y) + xf(x)) = y + (f(x))^2$

I would like some help with finding all real valued functions that satisfy this equation:  $f(f(y) + xf(x)) = y + (f(x))^2$  I tried the usual substitutions like $x = y = 0$, but my experience with this kind of problem is very limited.  EDIT: I'm an idiot and copied the wrong right side. Updated it now.


How does an isolated electron in deep space 'know' it is spinning?

This is a question about Mach's principle. Why is Mach's principle still an open question? In particular, if inertia arises from distant matter, Mach's principle raises the question would a particle have inertia in a universe with only that one particle. Why is this still an open question? Do the thoughts below help settle such questions?  This question (and the title) come from  The most highly upvoted  says      This is a longstanding problem in physics and has not been wholly   solved to anyone's satisfaction. It's not just rotational motion, any   motion is subject to this concern. Very basically, what is "motion"   for a singular object in its own universe?   The question talks about Mach's principle, General Relativity, and Brans-Dicke theory.   Asking a similar question about electron spin seems obvious, but I didn't see one anywhere.   As  shows, an electron has an intrinsic spin with half integer values. The reason is that the wave function has boundary conditions. The value at $\theta=0$ must be the same as at $\theta = 2\pi$. Other sources say it is just an experimental fact. Either way, and electron has spin and angular momentum.  It seems this must apply to an electron in otherwise empty space. It doesn't seem right to argue that it may not have an angular momentum. Is there something wrong with this thought?


How to configure extra buttons in Logitech Mouse

Can anyone tell me how to configure all the buttons on a  under Ubuntu 12.04?  Specifically, I like to make one of them just the Ctrl key (for control clicking webpages) and another one Ctrl+W to close tabs.  I also normally make the scroll wheel page down for each click (otherwise it hurts my arms to be scrolling so much).  I make pushing the wheel to the left = pageback and pushing to the right = page forward.  I've searched for other answers to this and found something related   But when I posted a followup post to solve the issue, no one responded --perhaps I made the mistake of posting to a question that had been "solved."  I'm not sure how I'm supposed to reopen a question that is pertinent to my question but doesn't quite solve mine.


How to properly find the spectrum of the Quantum Harmonic Oscillator?

We want to find the spectrum of the Harmonic Oscillator Hamiltonian: $$H=\frac{\hat{p}^2}{2m}+\frac{1}{2}m\omega ^2 \hat{x}^2$$ From what I have seen in many books the procedure is as follows: We can define a destruction operator $a$ and a creation operator $a^\dagger$, such as: $$H=\frac{\hat{p}^2}{2m}+\frac{1}{2}m\omega ^2 \hat{x}^2=\hbar \omega \left(a^\dagger a +\frac{1}{2}\right)$$ We then call: $$N := a^\dagger a$$ Now: if we find the spectrum of $N$ we have automatically found the spectrum of $H$, obviously. So let's start digging for the spectrum of $N$: we can easily prove that: $$[a^\dagger , a]=-1 \ \ ; \ \ [N , a]=-a \ \ ; \ \ [N , a^\dagger]=a^\dagger$$ And now, using these commutators, we can show the following: calling an eigenstate of $N$: $|n\rangle$ (so: $|n\rangle \ | \ N|n\rangle = \lambda _n |n\rangle$) $$Na^\dagger|n\rangle=(a^\dagger N + [N , a^\dagger])|n\rangle=(\lambda _n +1)a^\dagger | n \rangle$$ $$Na|n\rangle=(a N + [N , a])|n\rangle=(\lambda _n -1)a | n \rangle$$ So now, with this, we have managed to prove two things:  The operators $a^\dagger , a$ by acting on an eigenstate of $N$ allow us to find another eigenstate of $N$ (Fact 1) The newly found eigenstate has eigenvalue one unit higher or lower, with respect to $\lambda _n$, depending on which of the two operators we chose to use (Fact 2)  Wonderful. Another thing that we can prove is that it must exist an eigenstate $|0\rangle$ of $N$ such that: $$a|0\rangle=0 \ \ \ (Fact \ 3)$$ this can be easily proven: the eigenvalues of the Harmonic Oscillator Hamiltonian must be positive (we omit the proof of this), but the operator $a$ always lowers the value of $\lambda$ by one, so the only option is that, at some point; applying $a$ on an eigenstate of $N$ returns the null vector. Now here is my problem: In all the sources that I have found the author then goes on to state that fact 1, 2 and 3 allow us to say that the complete collection of all the eigenstates of the Harmonic Oscillator Hamiltonian is $$|n\rangle = K_n (a^\dagger)^n|0\rangle \ \ \ \ \ \ n \in \mathbb{N} \tag{1}$$ with $K_n$ some number. So essentially all the eigenstates can be found by applying the creation operator $a^\dagger$ to the lowest state $|0\rangle$. My problem with this is: surely all the vectors that we can obtain with (1) are eigenstates of $N$ but there could be other eigenstates hiding somewhere! We have never managed to prove, in all this, that all the eigenstates of $H$ are findable by the creation and destruction operators, there could be other eigenstates that we cannot reach by applying $a,a^\dagger$. How can we show that this is not the case? How can we show that all the eigenstates are in (1)? Is there something that I am missing?


Using Laurent series to evaluate integral

Use the Laurent series of $e^{1/z}$ on the punctured plane $\mathbb{C} - \{0\}$ to compute $1/\pi \int_0^\pi e^{\cos\theta}\cos(\sin\theta-n\theta) d\theta$ for $n=0,1,2,...$   I have been trying to attempt this question from my complex analysis book and I am not sure where to even begin. All I know is that the Laurent series of $e^{1/z}$ is $f(z)=\sum_{n=0}^{\infty} \frac{1}{n!}\frac{1}{z^n}$, for all $|z|>0$.   I have no idea how this relates the the integral though because there is no $e^{1/z}$ only a $e^{\cos\theta}$ in the integral. I thought maybe I have to put the $\cos\theta$ values into Taylor form but I'm not sure if that's correct.  Any help is greatly appreciated! Thanks :)


Is $\large \frac {\pi}{e}$ rational, irrational, or trandescendal?

Is there an argument for why $\large \frac {\pi}{e}$ is rational, irrational, or trandescendal? Can the quotient of any two transcendental numbers (which are not rational multiples of each other) be rational, or at least irrational? Thanks.


Notation: the set of two-element subsets of $\Bbb N$

Let $\{a,b\}\subseteq \Bbb N$.  Is there a special name or notation for sets of this type, for example $\Bbb N^{2\ge}$?  Any subset size may be used, but the specific size and denoting that order does not matter is part of my interest in this notation, i.e., subsets of size $n$ of set $X$.  Particularly inspired by this question: .


Why is the Fisher Information matrix positive semidefinite?

Let $\theta \in R^{n}$. The Fisher Information Matrix is defined as:  $$I(\theta)_{i,j} = -E\left[\frac{\partial^{2} \log(f(X|\theta))}{\partial \theta_{i} \partial \theta_{j}}\bigg|\theta\right]$$  How can I prove the Fisher Information Matrix is positive semidefinite?


Visualizing clustering on 2D binary data

I have a 2D binary array (size 1445 by 120), which I have clustered into 10 clusters using Python's  method. Each of the 1445 samples is given a cluster index of a number from 0-9.  My question is this: Is there a way to visualize these clusters in a 2D space, so that it looks something like this?: . I'm having trouble thinking of a way to map 2D binary data into coordinates. The data is very sparse and only ~5% are 1s, the rest are 0s. Any thoughts?


I do not mean that I deserved a Kofia hat, but today I asked and answered questions, all of which have at least one upvote.  Are there another requirement for the hat?     Kofia           first post between 12/26 and 1/1


Three negative and three positive $1$s in a serie

I want an alternating series formula that generates three negatives and three positives together.I know that we can do the same except that it is two negative and three positive can performed by triangle numbers.(See the link below.But I cannot find anything that generates three negative and three positive.For this we should do three odd and three even series and then put it in the power of $-1$.  Recommended:  update1:The series:${1,1,1,-1,-1,-1,1,1,1,-1,-1,-1,...}$  update2:We didn't learned floor function or trigonometry yet.


I have inserted three images in my superuser question - see .  The links were all inserted as [![enter image description here][1]][1]. It seems to work fine, but I would expect simpler syntax ![enter image description here][1] and when I have edited it to such syntax, it still seems to work.  I was inserting them by clicking to Image button and copying an image from clipboard.  To keep the question self contained, I am adding a small image into this question as well.


How to format a double with fixed number of significant digits, regardless of the decimal places?

Maybe my wording is not clear so I am trying to explain by example:   if I have a double like 123.4567 I would like to format it as 123  if I have a double like 12.34567 I would like to format it as 12.3 if I have a double like 1.234567 I would like to format it as 1.23   Of course I can do this with a switch/case statement but I am wondering if is there any built in or utility formatting, what can do this out of the box.  Thanks in advance


Show that $I = \{a +\sqrt2b \in \Bbb Z[\sqrt2] : a$ and $b$ are both multiple of $5\}$ is a maximal ideal.

Let $I = \{a +\sqrt2b \in \Bbb Z[\sqrt2] : a\text{ and } b\text{ are both multiple of }5\} \subset \mathbb Z[\sqrt 2]$. I have shown that $I$ is an ideal.   Now I want to show that it is maximal. Since I can write   $$I = 5\mathbb Z[\sqrt 2] = \{ 5(x+y\sqrt 2): x, y, \in \mathbb Z\},$$  I guess $\mathbb Z[\sqrt 2] / I\cong \mathbb Z/5\mathbb Z$. This is a field and thus $I$ is maximal. I am not sure about if the $\cong$ is true though.


How do I get the raw field value in a twig template?

myfield is a plain text field. {{ content.field_myfield }} renders the field with HTML markup and the field label.  How do I render the raw value of the field? {{ content.field_myfield.value }} doesn't work.


I already know how to prove that if the function $f$ has a right inverse, it implies that $f$ is surjective. But how can I prove that if $f$ is surjective it has a right inverse in a formal way?


What are the current numbers for freight/goods/workers per zone in Simcity 2013

I've been trying to find some good numbers for zone statistics, and due to various patches, there has been a great deal of disparity between the results I've found. The page at  has fantastic information, but due to the date of the post I'm sure it is quite inaccurate at this point. Does anyone know where to find up to date data like this? I would gladly do some testing myself to generate a new list, but I won't have access to the game until I get home in a couple of days, and I'd like to crunch some numbers and do some planning beforehand.


If $H\leq G$ of index $p$ in $G$ and $p\mid |G|$ then $H\trianglelefteq G$

Given that $H\leq G$ of index $p$ in $G$, where $p$ is the smallest prime integer such that $p \mid |G|$, then $H \trianglelefteq G$. I would appreciate some hints, as I don't even know where to begin. We can use a group action of $G$ on the left cosets of $H$ by left multiplication, but I don't know how to move further, and, particularly, how to use the fact that $p$ is the smallest prime dividing the order of $G$.


Hi I have ubuntu 18.04.4 dual boat with wind 10, after I updated my windows then I cannot update my ubuntu because gives the following errors:

W: GPG error:  precise Release: The following signatures were invalid: 630239CC130E1A7FD81A27B140976EAF437D05B5 E: The repository 'http://us.archive.ubuntu.com/ubuntu precise Release' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.


How are sites sorted in the all sites in the Stack Exchange Android app?

The list of Stack Exchange sites within more Stack Exchange communities are sorted in ascending order in the dropdown like below.  Whereas in the Stack Exchange Android app, it is not sorted in ascending order. First I thought it was sorted based on "live" and "beta" sites. But after scrolling down I found a few more "live" sites are in between the "beta" sites. Here is a screenshot from the app.  While writing this question I found the sort pattern is quite similar as of in . But this doesn't make any sense in app. Can we follow a common sorting approach in both site and app?


split string after symbol and get the string after the symbol

I have a string as var a = "000020097613 / 0020";. How can I get the string in two different variables which are currently separated by / now?  I want as below:  var b = "000020097613"; var c = "0020";


Can you please spot the error? I am getting 'null' in the System.debug. However, Account has some value in 'Type' field.    trigger UpdateAccountType on Contact (after insert) {         for(Contact con: Trigger.new){             System.debug('Account Type' + ' ' + con.Account.Type);          }      }


I've read in several articles that we don't usually use state verbs with the present continuous   But our Professor said that we do use some of them in the present continuous to emphasise that a situation is temporary or for a period of time around the present  and he gave this example :     Ella’s with us at the moment. The children are loving having her here   and now I'm confused ..


Electrons fly on certain orbits around nucleus. why do not they radiate waves and crash to the nucleus?

How to fill the gap between classical physics and quantum physics?


Lovecraftesque Story with a Giant Stairwell

Long time ago, I read a story which in retrospect I'd classify as Lovecraftesque in style, though I doubt it was one of HPL's own works (it doesn't match any of HPL's stories I've read long afterwards). I don't remember the title nor the author thereof. It had the following elements:   One of the characters managed to escape from an eldritch temple of sorts, but had an urge to return, crawling back on his arms and legs in his sleep. I remember the character described as having sores on his limbs, but I don't remember if it was in the process of praying, escaping, or trying to return. The temple was a giant well-like hole in the ground, with a spiral staircase and niches in the walls. The eldritch entities that demanded worship were normally invisible; it took drinking some special substance to begin seeing them, but the effect of that was lasting. The entities' shape included a vermiform body, though I'm not sure if it had any limbs; IIRC they also included a sphere or halo or something like that on top. The events of the story were taking place during some expedition through wilderness or at least deep foreign land. I'm inclined to believe that the story dates back to the 90s at the latest, and is likely older than that. I'm not sure what was the date within the story, but it was probably no later than the traditional Lovecraftian era.   What story might this be?


How was Nearly Headless Nick unpetrified?

In Harry Potter and the Chamber of Secrets we see that Nearly Headless Nick is petrified (for lack of better description) at one point by the basilisk:     It was Nearly Headless Nick, no longer pearly-white and transparent,   but black and smokey, floating immobile and horizontal, six inches off   the floor.      -Harry Potter and the Chamber of Secrets, Chapter Eleven (The Dueling Club).   I don't recall any mention of Nick recovering in CoS but he does make many appearances in the later books in the series, therefore we know that he does recover.  Since he was a ghost he couldn't consume the mandrake potion directly.  Is there any indication of what is done to bring Nick back to his typical ghostly state?


What is UV unwraping and what do the different unwrap options mean? In what ways can we cheat unwrapping?

As a beginner, I wanted to know, what UV unwrapping is and how it works.  What is it used for? Is UV unwrapping necessary or can we cheat it?  What do the different unwrap options mean and in what situations do we need to use them in?


Passport book cover is slightly detached from page

My Indian passport book cover is detached from the main book, but all other information, as well as the book is fine. I am traveling to India in 2 days. What should I do? Will there any problem at the airport?


Why is the application title bar hidden under Unity's top title bar?

In Ubuntu 14.04, The title bar of my application goes under the main title bar of Unity.  In the image below, the selected window is of Download Manager, but its title bar is hidden under unity's top title bar.    I find this issue occurring with web apps and standalone apps.  Ideally it should look like this:


Rudin Functional Analysis Chapter 2 Problem 16

Suppose that $X$ and $K$ are metric spaces, and $K$ is compact, and the graph of $f:X\rightarrow K$ is a closed subset of $X\times K$. Prove that $f$ is continuous. Show that compactness of $K$ cannot be omitted from the hypothesis, even when X is compact.    My solution: i tried doing it by proving the continuity by sequential criterion and for this i start with a sequence $\{x_n\}_{n=0}^{\infty}$ converging to some $x\in X$. Then $S=\big(\bigcup\limits_{n=1}^{\infty} \{x_{n}\}\big)\cup \{x\}$ is compact subset of X and hence $S^*=\big(\bigcup\limits_{n=1}^{\infty} (x_{n},f(x_n))\big)\cup (x,f(x))$ is closed in $X\times K$ and since $(S\cup \{x\})\times K$ is compact hence $S^*$ is compact and hence have a convergent subsequence. i am not able to move forward. any type of help will be appreciated. Thanks in advance.


Printing SQL Query output in PHP in JSON encoding

I am a php beginner and in order to create a chart I need a php file with json data, which is created through a database query. My query code looks as follows:  <?php  $servername = "xyz";  $username = "x"; $password = "y"; $dbname = "z";   // Create connection $mysqli = new mysqli($servername, $username, $password, $dbname);  $data1 = [];    $sql = "SELECT ROUND value, timestamp FROM table"; $result = mysqli_query($mysqli, $sql); while ($row = mysqli_fetch_array($result)) {     array_push($data1,[intval($row['timestamp']),doubleval($row[0])]); }  ?>   Now I want to display the code by printing the query so it has a json format like:  [ [12000000000000,5.5],   [12000000000000,5.5],   ....... ]   I tried several things like print_r etc. but nothing quite got me there.


Where to place a diode - DC 12v motor controller

I'm building a controller for a DC motor. I'm using a 12V DC motor from windscreen wipers.   Here is my circuit diagram and a video of the simulation I made.      Its purpose is to drive the motor for certain amount of time in one direction and then the same amount of time in opposite direction.  I was told that I should put a diode somewhere around the relay and MOSFET.   Can someone explain to me why that diode is needed, and what exactly it will do?  Thank you!


Calling methods on objects that are attributes of other objects

Im new to java so i imagine this is a very obvious question but for the life of me i dont know why this dosent work, i am extremely cluless  public class start {  public static void main(String[] args){      Shop shop = new Shop();     shop.tellMe(); }  static class Shop{     Item wares;       void tellMe(){         this.wares.itemOut();     } }  public class Item{     int price = 0;     String name = "Sunglasses";      void itemOut(){         System.out.println(price + " " + name);     } }   }  I feel like this should work, but when i run it i get   Exception in thread "main" java.lang.NullPointerException at start$Shop.tellMe(start.java:14) at start.main(start.java:6) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)m


Limit of integral of $\frac{2nx^{n-1}}{1+x},\, x\in [0,1]$

For $n = 1, 2, ...., $ let $$f_n(x)= \frac{2nx^{n-1}}{1+x},\, x\in [0,1] .$$  Find $$ \lim_{n \to \infty} \int \limits_{0}^{1} f_n(x) dx ?$$  The sequence is not uiform convergent on $[0,1]$, because limit does not exist at $1$. How to approach further for the problem. Is dominated convergence theorem applicable?


ubuntu 19.10 cant install VMWare Workstation

I just installed Ubuntu 19.10 on my desktop. I am trying now to install VMWare Workstation but I keep getting error messages: sh: 0: Can't open VMware-Workstation-12.5.6-5528349.x86_64.bundle  Please can someone help me?


The excerpt below is taken from a web article I was reading.  The powerful machine LHC accelerates and steers billions of protons to collide with billions of other protons. The goal of this work is to answer fundamental questions to understand Nature. But what really happens when protons collide? Protons consist of quarks bound by gluons, and in a head-on collision between two protons it is the constituent quarks and gluons that collide. Inside each proton you can find a "sea" of quarks and gluons. Why so many? Haven't you learned that there are only 3 quarks inside a proton? Well, we say that a proton consists of 3 "valence" quarks, but also a whole bunch of “sea” or “virtual” quarks and anti-quarks stemming from gluons. When protons collide with such large energies as at the LHC, the collision results in a shower of all types of particles, the ones usual matter is made of, and others that only existed just after the Big Bang. The new particles are usually much heavier than the original colliding particles, thanks to the relation $E=mc^2$. To say it simply: All the energy we put into the collision can come out as mass instead!  Source:  I think that when protons collide with each other their kinetic energy is converted into matter in form of new sub-atomic particles and protons also get broken down though a quark cannot exist as an individual unit. Do those quarks get together again to make up a proton? Where do those quarks go? Why don't they use electrons instead of protons at CERN? I understand that an electron is an elementary particle which means, according to the current knowledge, an electron is not made up of any more basic particles. If electrons are used, their huge kinetic energy would also be converted into sub-atomic particles though the electrons themselves would remain intact. Perhaps, using electrons would not produce as many sub-particles since they are almost 1850 times less massive than protons so their kinetic energy would always be less than that of protons. Besides this, it might be possible that since electrons do not break down therefore, for some reason, this also limits the creation of new sub-atomic particles. Could you please help me with it? Helpful links:  Ars Technica. , YouTube, Oct. 16, 2018.  Seeker. , YouTube, Aug. 18, 2016.


I'm trying to show only content with all paragraphs (possibly divs,...) but with no attached images.  I had some success with:  echo preg_replace('/<img[^>]+\>/i', '',get_the_content());   But it removes paragraphs not just images.. Any idea why?


Writing a bash script on a new box, Escaping Code

There may be a question out there for this somewhere. But I wasn't able to find it easily.   Basically I want to write a bash script on a new box. A script that I've previously used.   Example:  #!/bin/bash -ex hi='hello world!' echo $hi   I've always used (for multiline output)  cat > script.sh <<EOF #!/bin/bash -ex hi='hello world!' echo $hi EOF   But as you may have noticed this has issues with $hi, and other symbols. Is there a good way to do this? Tips Tricks?


How do I use a header location in jQuery?

Can I use a header location in jQuery for redirection or refresh?  Like in PHP:  header('location:www.google.co.in'); header("Refresh:1,url=home.php");   If not, what is the alternative way?


why python treat list and integer variable in different way?

Example1:  x =[] def func():      print('x value is:', x)     x.append('member1')     print('x value is now:', x) func() print('x value is', x)   After run, the result will   ('x value is:', []) ('x value is now:', ['member1']) ('x value is', ['member1'])   example2:  y = 50 def func():     #global y     print('y value is:', y)     y = 2     print('global y is change to:', y) func() print('y value is', y)   after run:  UnboundLocalError: local variable 'y' referenced before assignment   the solution is un-commment the line global x but why python treat list and interge in different way ? why list x don't require global? why python don't respond for example 1 for list like this:  local variable 'x' referenced before assignment  Thanks!


It seems to me that down-voting is the one process in Stack Overflow that is not really subject to review. While many would argue that the current methods for managing down-votes are adequate, I do not feel that they competently ensure a checks-and-balances approach to the use of down-votes. The following arguments summarize why I think the current down-vote policy is not as effective as what reviewing could provide:   There is no real check against down-voting a question regardless of the whether the down-vote was deserved. Any user can down-vote a post without explanation and without assessment.  The -1 penalty for down-voting an answer may provide incentive to not recklessly down-vote, but having a reviewer apply a penalty for a unjust down-vote would seem far more appropriate. Additionally, this would allow answers that are obviously inappropriate to be down-voted without penalty to the reviewer.    While I believe the format of Stack Overflow should not be flippantly changed without due thought, I believe this issue is one of the few areas in which the topic of alternative solutions should at least be addressed. I know reviewing down-votes may be a hefty task (as they happen so frequently) but we certainly have the user base to accomplish such a task. What'cha think?


I have a JFrame. This JFrame contains a JButton. I click the JButton and 10 JTextFields are created.  the problem: I cannot see them until "I force a repaint()" by resizing the window. Only then do I see the JTextFields created.  CODE:  JPanel points = new JPanel();  //Creating the JTextFields: for (int i=0; i<10; i++) {     JTextField textField = new JTextField();     points.add(textField); }  repaint(); this.repaint(); super.repaint(); points.repaint();     THANK YOU - after the for loop, I just called points.validate() and it worked...


AF 3550 APRIL 24 2020 Paris to Detroit cancelled?

Was AF 3550 Paris to Detroit actually cancelled On April 24 2020? The airline says it STILL hasn’t been so and are refusing a refund except of taxes.


Proving equation with binomial coefficient

$$\sum_{i=1}^n i^2 C^i_n = n(n+1) \cdot 2^{n-2}$$ I could use some help with proving that this equation stands. Should I try to use mathematical induction?


Java copies whole object when passed in function?

My question resembles a lot the battle between "is java pass-by-value or pass-by-reference". But I still can't understand what happens when I pass an object in a function. For example let's say that I have a huge HashMap and I want it to be accessible by every object and every class. So I pass it as an argument to all functions that need it. To be more specific, I create this HashMap in the main function and then I have some objects that require it.   main() {     HashMap<Integer,Set<Integer> dataset=readDatasetfromFile(file);     ArrayList<Object> objects=new ArrayList();      //assume that I create and fill the list with objects      for(int i=0;i<objects.size();i++)     {         int variable=objects.get(i).doSomething(dataset);     }  }   But I don't understand if it copies it or not. There is no point in copying it every time I call a function, because that is a waste of time. It would be nice if it just passes the object as a reference. Thank you.  As I said none of the answered posts explicitly says if the whole object is copied bit by bit to the function or no, and that is my main question. So I don't see any resemblance to other questions.


I hear in many articles the word parameters and hyperparameters but I don't know what they mean by that. Are they variable or the weights of the nodes?  explain me in an intuitive way as an analogy please


Prove that $\sin A+\sin B+\sin C\leq \frac{3}{2}\sqrt3$

If $A,B,C$ are the angles of a triangle, prove that $\sin A+\sin B+\sin C\leq \frac{3}{2}\sqrt3$    I want to prove this inequality without Jensen's inequality, as Jensen is not in my syllabus. Let $\sin A+\sin B+\sin C=x$ $2\sin\frac{A+B}{2}\cos\frac{A-B}{2}+2\sin\frac{C}{2}\cos\frac{C}{2}=x$ $4\cos\frac{A}{2}\cos\frac{B}{2}\cos\frac{C}{2}=x$ I do not know how to solve it further. I want to convert $\sin A+\sin B+\sin C=x$ into a quadratic equation of some trigonometric function and then use the discriminant property. Please help.


Is there anything to stop a Gold Tag person editing a tag in to close any question they want?

Someone with a gold badge in a tag can Dupe Hammer, and close it in one go, like a moderator.  Is there anything to stop a Gold Tag user from editing in that tag to close it? Or is that allowed, like edit to unvote?


LaTeX doesn't recognize "et al." in the Bibliography

I'm using Jabref to manage my Bibliography.  Sometimes, I put directly:     First Author et al.   when adding the article author's name in Jabref.  When compiling my .tex file, LaTeX doesn't recognize the et. al as more names. It takes it as a name/surname.  This is an example of a Bibliography entry in Jabref.  @ARTICLE{Wolf2003,     author = {Wolf, K.et al.},     title = {Compensation mechanism in tumor cell migration: mesenchymal–amoeboid     transition after blocking of pericellular proteolysis},     journal = {J. Cell Biol.},     year = {2003},     volume = {160},     pages = {267–277},    }   This is a .texMWE with the bib entry mentioned:  \documentclass[11pt]{book}   \usepackage{cite}   \bibliographystyle{unsrt} \begin{document}   Here is the bib entry mentioned\cite{Wolf2003}    \bibliography{bibfile}  \end{document}   Here's the output:   How can I solve this problem?


How did Pauli and Fermi deduce the existence of the neutrino?

From :     The neutrino was postulated first by Wolfgang Pauli in 1930 to explain how beta decay could conserve energy, momentum, and angular momentum (spin). In contrast to Niels Bohr, who proposed a statistical version of the conservation laws to explain the event, Pauli hypothesized an undetected particle that he called a "neutron" in keeping with convention employed for naming both the proton and the electron, which in 1930 were known to be respective products for alpha and beta decay.[6][nb 2][nb 3]      n0 → p+ + e− + νe James Chadwick discovered a much more massive nuclear particle in 1932 and also named it a neutron, leaving two kinds of particles with the same name. Enrico Fermi, who developed the theory of beta decay, coined the term neutrino (the Italian equivalent of "little neutral one") in 1933 as a way to resolve the confusion.[7][nb 4] Fermi's paper, written in 1934, unified Pauli's neutrino with Paul Dirac's positron and Werner Heisenberg's neutron-proton model and gave a solid theoretical basis for future experimental work.   Can you explain why beta decay could not be explained by adding that tiny amount of energy (attributed to the neutrino) to the KE of the emitted electron?


I am looking in the Collections framework of Java for a LIFO Structure (Stack) without any success. Basically I want a really simple stack; my perfect option would be a Deque, but I am in Java 1.5.  I would like not to have to add another class to my structure but I am wondering if that is possible:   Is there any class in the Collections framework (1.5) that does the job? If not, is there any way to turn a Queue in a LIFO Queue (aka Stack) without reimplementation? If not, which Interface or class should I extend for this task? I guess that keep the way that the guys of Sun have made with the Deque is a good start.   Thanks a lot.  EDIT: I forgot to say about the Stack class: I have my doubts about this class when I saw that it implements the Vector class, and the Vector class is a little bit obsolete, isn't it?


Specify password when connecting to a Samba share

I can connect to a Samba share on my Raspberry Pi with the following:-  open smb://MilliwaysPi4.local/pi   This then prompts for a password. macOS offers to remember the password in Keychain, BUT this still needs to be confirmed, and it attempts to use my macOS username, so needs to be edited.  Is there a way to specify the password in the command line?


How do i secure my login. php page from sql injection attacks?

i was told that my login page is still not secure even if i use the mysqli_real_escape_string function. can you please look at my code and show me a way i could better secure my login. here is the code:  <?php session_start(); include("includes/config.php");  if(isset($_POST['login'])){ $email = mysqli_real_escape_string($connection,$_POST['email']); $pass = mysqli_real_escape_string($connection,$_POST['pass']); $pass = md5($pass);  $get_user = "SELECT * FROM members WHERE user_email='$email' AND user_pass='$pass'"; $run_user = mysqli_query($connection,$get_user); $check = mysqli_num_rows($run_user);  if($check==1){     $_SESSION['user_email']=$email;     $rows_check = mysqli_fetch_array($run_user);     $activate = $rows_check['activate'];      if($activate == 0){         echo "<script>window.open('lock_out.php','_self')</script>";     }     if($activate == 1){         echo "<script>window.open('home.php','_self')</script>";         $stat = 1;         $update = "UPDATE members SET online='$stat' WHERE       user_email='$email'";         $run_update = mysqli_query($connection,$update);                 } } else {     echo "<script>alert('Password or email is not correct!')</script>";     echo "<script>window.open('index.php','_self')</script>";   } } ?>


Explain what programs (based around LaTeX) I need to download (Windows) in order to write up a mathematical document (must be able to do basic things like type mathematical symbols, insert equation labels, make changes to font colours and sizes etc.)  There are many variants of programs, which I am confused about. If possible, explain each one: LaTeX, MiKTeX, TexMaker, TeXworks, LyX etc.


Install Ubuntu with Windows 8 on Separate partition

I am trying to install Ubuntu with windows8 -dual boot, But I want to install Ubuntu on separate partition, like my windows 8 installed on C drive and i want to install Ubuntu on D drive. Tell me the installation steps.


Ubuntu 14.04 apt-get fails on Google Chrome

I just installed Ubuntu 14.04 on a new hard drive. When I run sudo apt-get update, I get the following error:  W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release  Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)  E: Some index files failed to download. They have been ignored, or old ones used instead.   My sources.list file, indeed, makes no mention of any "binary-i386". Should I manually add that line to the file?


Finding line length while editing in QGIS?

I am using QGIS.   I would like to know if there is any way during the editing phase of a vector (line or polygon) to know the length of the line (total and partial) that is being created?


Seeing partitions on hard drive in Ubuntu 14.04

How do you see and adjust partitions on a hard drive in Ubuntu 14.04? I want to add Openelec to my second partition.


Why is it called Sylvester's Law of Inertia?

By "Sylvester's Law of Inertia," I mean:    How does the name "Law of Inertia" fit with the statement of the theorem? I guess it's from physics, but... I just don't see the connection.


Hide or collapse individual comments in chat

I spend a lot of time in SF chat. We like to post a lot of pictures in chat. They're usually not offensive or anything, and 90% of the time they're funny and relevant.  That said, there are times when it would be nice to be able to hide or collapse a chat message. Sometimes it's an image or an animated gif that's annoying/distracting, or sometimes there's text that isn't offensive, but I don't necessarily want it on my screen.  Can we have an option that allows individual messages to be hidden from view?


call one constructor from another in java

This was the question asked in interview. Can we call one constructor from another if a class has multiple constructors in java and when?How can I call I mean syntax?


What happens when crowd-sourcing fails utterly, that the technically incorrect answer gets up-voted while the technically correct answer is down-voted because is is unpopular.  This is possible because crowds are known for group-think and are not known for logical, reasoned thinking.  It is quite possible for a provably-correct answer to fail the popularity contest of voting.  What happens then?  Can we do a correctness review?


Statements equivalent to the Axiom of Choice

The Axiom of Choice reads:     The product of a collection of non-empty sets is non-empty.   As you know well, this axiom is equivalent to many other statements. A few examples (probably the most known) are the following:   Zorn's lemma: Let $(P,\ge)$ be a poset in which every chain has an upper bound. Then $P$ has a maximal element.   This is used in a number of different places to prove very powerful theorems. A couple of examples I can think of right now are: the proof that every ring has a maximal ideal (commutative algebra) and the  (functional analysis).   Well ordering theorem: Every set can be well-ordered (i.e. it admits a total order such that every subset has a least element). Tychonoff's theorem: Every product of compact topological spaces is compact.   This is used for example in the proof of  (again functional analysis).   gives various more. Among them:   Tarski's theorem: If $A$ is an infinite set, then there is a bijection $A\to A\times A$.   (As @Wicht dutifully commented, Tarski's theorem is the name given to the implication $|A|=A\times A \Rightarrow$ Axiom of Choice, while the other implication was known before the proof of this fact by Tarski.)   Every vector space has a basis.   My question is: what are other useful statements which are equivalent to the axiom of choice? Where are they used, and to prove what?  P.s.: By "useful statements" I mean either statements which are important theorems by themselves (as Tychonoff's theorem) or that are directly used in (simple versions of) the proof of important theorems (as Zorn's lemma).


Closed form for a formula with a summation over $i\binom{n-i}{k-1}$, and combinatorial proof?

I was trying to simply an expression in an exercise related to randomized algorithms. Here is the expression which I have obtained at the end.  $$ \displaystyle\frac{\displaystyle\sum_{i=1}^{n+k-1} i \binom{n-i}{k-1}}{ \displaystyle{n \choose k}}$$  Is there any way to simplify the numerator so that the whole expression simplifies into a nice closed formula? A combinatorial approach would be greatly appreciated.


Understanding the blue dotted lines in an ACF from R

I'm having a bit of trouble understanding the blue dotted lines in the following picture of autocorrelation function:    Could someone give me a simple explanation, what they are telling me?


What kind of object is being checked against the cache when a new query arrives?

After reading several resources, it's not clear to me what kind of object is being checked against SQL Server Plan Cache when a new query arrives.   I see 3 possible options:   The pure query text. The parse tree (the resultant object of the parser)    The query plan (the resultant object of the optimizer. Below, I refer to it as a "compiled query").   Now, since the cache is actually called "The Plan Cache", it may indicate that option 3 must be the correct one.   However, it seems to me that the third option must be false. First, because the "Plan Cache" actually caches other object than just compiled plans (see ). Secondly, as I see it, the purpose of accessing the cache is to prevent an unnecessary compilation of the arrived query. Thus, if the access to the cache is done against a compiled query, it requires the compilation of the new query, which misses the whole point.   I read one resource that supports this view, saying that the cache is being checked before the Query Optimizer takes place, i.e., before the generation of the query plan (taken from Professional SQL Server 2012 Internals and Troubleshooting, pg. 113, under the "Query Optimization" section):      The current model provided by the SQL Server team works something like   this:      Is a valid plan cached? If yes, then use the cached plan. If no plan   exists, then continue [and apply simplification and optimization,   which results in a query plan].   So it seems option 2 is the right one. However, in two other resources I found a support for option 3. This is the first one ():     When a query is submitted to the server, an estimated execution plan   is created by the optimizer. Once that plan is created, and before it   gets passed to the storage engine, the optimizer compares this   estimated plan to actual execution plans that already exist in the   plan cache . If an actual plan is found that matches the estimated   one, then the optimizer will reuse the existing plan, since it’s   already been used before by the query engine.   And The following text (taken from Microsoft SQL Server 2012 Bible, pages 1042 and 1044) claims the same: The query plan is checked against the cache after its generation (Note that it uses slightly different terms and it differs from the above text regarding the component that is responsible for the request to check the cache):     After the query execution plan generates [By the query optimizer], SQL Server stores it in the   Plan Cache [...] and   informs the Query Processor that the plan is ready to be executed.      [...]      When the query processor needs to execute a query, it first checks to   see if the query can reuse an execution plan already in the Plan   Cache. It’s much faster to find and reuse a Query Execution Plan than   to generate a new plan, even though that option is not always the best   solution.   Is there a decisive answer for this?


Should questions about SE site features be moved from all other metas to SO meta?

I wonder if questions about a feature that any SE site has on other metas belong on the StackOverflow meta.  For example, this question here:   It's asking about following a user, which applies to all other SE sites. Does this mean it's off-topic on English and Usage meta and should be moved to StackOverflow meta?


According to general relativity, speed is relative, so for example if you are running at  20 km/h and a car passes you at 30 km/h, the runner is actually moving at 50 km/h relative to the car.  Now imagine that 2 spaceships are traveling both at 99% the speed of light, and they pass each other in a linear fashion. Could it be argued that from 1 spaceships perspective,  you are traveling at 198% the speed of light relative to the other spaceship, according to special relativity, yet violating the constant speed of light?.


Are there any keyboard shortcuts for Windows 10 developer preview's virtual desktops ("Task View")?

I just installed Windows 10 developer preview but can't figure out how to cycle through the new virtual desktops with the keyboard.  I'm looking for the following shortcuts if they exist:   Switch to the next/previous desktop Go to desktop number N Close the current desktop Open a new desktop   Are these controls implemented yet?


I have a class like this:  using System; using System.Collections.Generic; using System.Linq; using System.Text;  namespace WindowsFormsApplication1 {     public class MyList<T> : List<T>     {         public int SelectedIndex { get; set; }          public T CurrentItem         {             get             {                 if (this.SelectedIndex > this.Count)                     return null;                  return this[this.SelectedIndex];             }         }     } }   I am creating a class that derive from list and create a property for getting the current item.  If SelectedIndex is a wrong value, I am returning null but it has an error     Cannot convert null to type parameter 'T' because it could be a   non-nullable value type. Consider using 'default(T)' instead.   I want the return value to be null not default(T).  what should I do?


How do I prevent screensaver and auto lock in Ubuntu 18.04.3?

I'm using 18.04.3 I read previous answers but the GUI seems different than previous answers as previous answers talk about older version.  I don't want screensaver and auto lock. My system automatically locks itself after few minutes of inactivity and also there's a screensaver. I want to disable this.


When I install the Ubuntu, I set a short password(<4). Now I want to change the other short password by "passwd" or change passphrase on "Password and Keys" program, it needs a password >4 char.


Change Ubuntu 17.04 to Ubuntu 16.04.2 LTS

I've upgraded my LTS version of Ubuntu to Ubuntu 17.04 and from the day I've upgraded I've been struggling to get this thing stable. Sometimes my Wifi adapter doesn't work properly and sometimes I can't even copy things properly.  So I want to revert back to Ubuntu 16.04 LTS.  Is there any way to get this done?


How is it possible that "I" (the user Krumelur) exists twice?

I was just about to answer a  about an iOS problem when suddenly a new answer appeared. It was given by me...? At least, that's what the username "Krumelur" indicates.       What really an interesting coincidence:   Both accounts have been active for almost the same period 3 years and 11 months, respectively 3 years and 10 months. Both of us are interested in similar tags Both have similar score (+- 2000)   Is this an error or are usernames really not unique? Do I have an evil twin? Or does the other one have an evil twin? :-)


How is Clan War Map position determined?

I am #10 in my clan (cause I'm farming) but I am #2 in clan wars. I don't have the strongest troops in my clan. I'm just wondering how the order is set up, the only thing i can think of is that it is based off of your defense, but I'm not sure. Anyone know?


How can I get vertex positions from a mesh?

I want to read the vertex x and y coordinates with a script or a function.  How can I do that?  The   appears to have no position I could use.  I'd take any alternative approach that could give me x and y coordinates.


I'm taking data from an external XML file, so I cannot make changes. Also I need all special characters.  This is XML  <item> <name>Lucy</name> <embed><iframe src='http://website.com style='something:somehow'></iframe></embed> </item>   This is sql table  $sql = "CREATE TABLE IF NOT EXISTS `models`(     `model_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,     `model_username` VARCHAR(250) NOT NULL,     `model_embed` TEXT NOT NULL )";   XML into SQL  foreach ($items as $item) {        $name=$item->name;        $iframe=$item->embed;  $ins = " INSERT INTO `models` (`model_username`, `model_embed`)          VALUES ('$name', '$iframe') }   And I get this error     1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' style='something:somehow' at line 9


javascript popup help when writing js to a table

I am trying to create a table dynamically with js and jquery.  The table works fine, but the first column is a link to a popup that displays a graph of the info in the corresponding row.  When I hard-code the table, the "graph" button does indeed launch a popup.  However, when I create the table dynamically, the popup doesn't launch - everything works fine except the graph is displayed in the same tab. This is the function that calls the pop-up    $(document).ready(function() {   $('form').submit(function() {     window.open('', 'popup',       'width=1100,height=500,resizeable,scrollbars');     this.target = 'popup';   }); });  // this is the dynamically created table function get_table() {   $.getJSON('/_ajax_candidates', function(data) {     $('#date').text(data.cur_date)     $('#graphTable tbody').remove();     for (let j = 0; j < data.df.length; j++) {       let formText = "<form action='/popwindow' method='post'>" +         "<input type='hidden' id='pone' name='port_one'        value = " + encodeURIComponent(data.df[j]['port_one'])  + " > " +         "<input type='hidden' id='ptwo' name='port_two'        value = " + encodeURIComponent(data.df[j]['port_two']) + " > " +        "<input type='submit' value='Graph' > </form>"        var row = document.getElementById('bodyStart').insertRow(j);       var cell1 = row.insertCell(0);       var cell2 = row.insertCell(1);       var cell3 = row.insertCell(2);       var cell4 = row.insertCell(3);       var cell5 = row.insertCell(4);       var cell6 = row.insertCell(5);       var cell7 = row.insertCell(6);       var cell8 = row.insertCell(7);       var cell9 = row.insertCell(8);       var cell10 = row.insertCell(9);       var cell11 = row.insertCell(10);       var cell12 = row.insertCell(11);       var cell13 = row.insertCell(12);       cell1.innerHTML = formText;       cell2.innerHTML = data.df[j]['port_one'];       cell3.innerHTML = data.df[j]['port_two'];       cell4.innerHTML = data.df[j]['pval'];       cell5.innerHTML = data.df[j]['beta'];       cell6.innerHTML = data.df[j]['std'];       cell7.innerHTML = data.df[j]['zscore_y'];       cell8.innerHTML = data.df[j]['zscore'];       cell9.innerHTML = data.df[j]['zscore_20dy'];       cell.innerHTML = data.df[j]['zscore_20d'];       cell11.innerHTML = data.df[j]['std_20d'];       cell12.innerHTML = data.df[j]['mean_20d'];       cell13.innerHTML = data.df[j]['cur_val'];     }   }); };     when i click the "graph button" in the table my current window is replaced with the graph instead of being generated in a popup window.  any help is appreciated.  I troll stackoverflow all the time but have never asked a question before.  thanks in advance


capture group with optional second capture group containing first group pattern

So i am trying to apply regex to a string in javascript. I just can't get the right pattern.  I Basically have a multiline string that contains a name with an optional amount at the end. Something like this Warrior II x2. I want one capture group for the name and one for the amount without x. So this should capture {Warrior II,2}  I tried this: ^(.+)(?:x(\d+))?$. the problem is this; the .+ will always match everything, including the amount. to the second capture group will always be empty. And since the name can contain anything even numbers and non ascii stuff I can't really replace .+ with something like \D+  So the question is how do I force regex to always capture the second group if it exists and not include that part in the first group. I even tried the lazy modifier with the .+ but that did no work either.  I hope i described my problem understandably.  I tested most of my regex with regex101.com


Hiding or disabling Database Connections in Catalog window using ArcObjects?

I am working on a project that I must limit  some functionality of ArcMap based on user permissions.  Is there any way to do that ?  for example I want to disable the Database Connections in Catalog windows  by using c# in ArcObjects


using regex to find and replace hostname in url

Currently I have my program able to achieve this with IP address using regex.Replace() to search the input string for an IP and swap it with the new one keeping the start and end of the URL   so with the following test1 goes from "" > ""  Regex ipAddress = new Regex("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b", RegexOptions.Compiled); string test1 = "https://11.1.11.11:8080/"; Console.WriteLine(ipAddress.Replace(test1,"22.2.22.22"));   however when I try this with a host name for example "" > "" the following code doesn't find the hostname? How come with the IP adresss it is able to find and replace the IP but with hostname it cannot?  Regex hostname = new Regex(@"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9]*)\.)*([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9]*)$"); string test2 = "https://google.com:8080/"; Console.WriteLine(hostname.Replace(test1, "facebook.com"));


Solutions to time-independent Schrödinger's equation with symmetrical (even) potential

A problem from Griffith's Introduction to Quantum Mechanics asks to prove the following:  Given a symmetric potential $V(x)$  $(=V(-x))$, the solutions to the time-independent Schrödinger's equation can always be take to be either odd or even.  I understand that given a solution $\psi(x)$, $\psi(-x)$ is also a solution.  Now, $\psi_{even}(x) = \psi(x) + \psi(-x)$ and $\psi_{odd}(x) = \psi(x) - \psi(-x)$ are also solutions to the equation.  Thus $$\psi(x) = \frac {1}{2}(\psi_{even}(x) + \psi_{odd}(x))$$  But $$\psi_{even}(-x) + \psi_{odd}(-x) = \psi_{even}(x) - \psi_{odd}(x)$$  and hence $\psi(x)$ is neither even or odd!  I am unable to resolve this issue.


Which one of this is the correct use of "one" as a pronoun?

(a) When one reads the Hindi literature of the twentieth century, he finds a striking contrast between the writings of Munshi Premchand and later day writers of popular Hindi fiction.      (b)  When one reads the Hindi literature of the twentieth century, one finds a striking contrast between the writings of Munshi Premchand and later day writers of popular Hindi fiction.   According to me, (b) should be the correct one as "one" cannot be used interchangeably with other pronouns when referring to the same thing. But the correct answer is (a). Can someone explain?


Is a spouse of a US permanent resident exempt from the travel ban? I am a U.K. passport holder

Two questions;    Are spouses of permanent residents currently allowed to travel to the US? I want to get back to my husband as I do not want to be separated at the moment. If they are exempt, how do I go about getting an ESTA or would it be better to have another type of visa? My ESTA was cancelled when the travel ban came into place.   Thanks in advance.


Is the spring constant $k$ changed when you divide a spring into parts?

I've always been taught that the spring constant $k$ is a constant — that is, for a given spring, $k$ will always be the same, regardless of what you do to the spring.   My friend's physics professor gave a practice problem in which a spring of length $L$ was cut into four parts of length $L/4$. He claimed that the spring constant in each of the new springs cut from the old spring ($k_\text{new}$) was therefore equal to $k_\text{orig}/4$.   Is this true? Every person I've asked seems to think that this is false, and that $k$ will be the same even if you cut the spring into parts. Is there a good explanation of whether $k$ will be the same after cutting the spring or not? It seems like if it's an inherent property of the spring it shouldn't change, so if it does, why?


How do I programmatically change file permissions?

In Java, I'm dynamically creating a set of files and I'd like to change the file permissions on these files on a linux/unix file system.  I'd like to be able to execute the Java equivalent of chmod. Is that possible Java 5? If so, how?  I know in Java 6 the File object has setReadable()/setWritable() methods. I also know I could make a system call to do this, but I'd like to avoid that if possible.


After installing Ubuntu 12.04 pc goes in GRUB rescue

As a part of my school lab I did following:     Starting off with win 7 installed Installed 10.04 in remaining space > worked Installed 12.04 in amother partition I created finished installation took out the disk.   After the 12.04 the system booted into Grub rescue mode. I didnt know what to do as I never used ubuntu so I just moved on to install 14.04 as part of lab hoping the previous grub loader problem will be solved then, by replacing Grub from CD.     After the 14.04 installation I still get the Grub resuce prompt.


Does using '&' versus 'and' matter for SEO

When creating web page titles, is there any difference between using the word 'and' in the title compared to using an ampersand?


Subspace generated by permutations of a vector in a vector space

Let $K$ be a field. Consider the vector space $K^n$ over the field $K$.  Suppose $(a_1,a_2, ... ,a_n) \in K^n$. What is the dimension of the subspace generated by all the permutations of $(a_1,a_2,...,a_n)$?  I think there are 4 different cases    $a_1=a_2=...=a_n=0$ $a_1=a_2=a_3=...=a_n \ne 0$ $a_1+a_2+...+a_n=0,$ $ a_1 \ne a_2$ $a_1+a_2+...+a_n \ne 0$ , $a_1 \ne a_2$


I recently installed Ubuntu 12.04, but now updates will not install. This is the error message:  The following packages have unmet dependencies:  linux-image-generic-lts-saucy: Depends: linux-image-3.11.0-19-generic but it is not installed   I have tried several of the terminal commands listed among the AskUbuntu answers, but get:  E: Could not open lock file /var/lib/dpkg/lock - open (13 - Permission denied) E: unable to lock the administration directory   The apt-get -f install doesn't fix the problem.  I am not a code monkey, so would someone please help me? Thank you.


How do you write this program on logarithms in Python?

I am trying to write a Python program to verify the law of logarithms which states that log(ab)=loga+logb.When I run the program it runs with certain set of numbers but it does not work always.I have enclosed my code below.Please help me. import math a=float(input("Enter first number:")) b=float(input("Enter second number:")) c=float(input("Enter a base:")) d=round((math.log(a,c)),1) print (d) e=round((math.log(b,c)),1) print(e) f=round((math.log((a*b),c)),1) print(f) if (d+e)==f:     print("We have verified the first property of logarithms")


How get next date by passing current Date in java

How do I get the next date(2014/03/21) given the current date(2014/03/20) in Java?  Code:   public static String getNextDate(String  curDate) {          String nextDate="";         try {            //here logic to get nextDate         } catch (Exception e) {             return nextDate;         }         return nextDate;     }


Decidability of the Riemann Hypothesis vs. the Goldbach Conjecture

In , Marcus du Sautoy claims that a proof for the Riemann hypothesis must exist (starts at the 12 minute mark).  His reasoning goes as follows:   If the hypothesis is undecidable, there is no proof it is false. If we find a non-trivial zero, that is a proof that it is false. Thus if it is undecidable there are no non-trivial zeros. This constitutes a proof the hypothesis is true, thus it is decidable.   This makes perfect sense, however only seconds earlier he states that the Goldbach conjecture might be undecidable.  It seems to me that the exact same reasoning we applied to the Riemann hypothesis could be applied to the Goldbach conjecture.  Just switch out the words "non-trivial zero" for "even number that cannot be represented by the sum of two primes" and to me this reasoning looks fine.  In fact as far as I can tell any statement that can be verified or falsified by example can be plugged into this to generate a proof it is decidable.  Since Marcus du Sautoy is considerably more qualified than I to speak about this I trust that there is something more complex going on behind the scenes here.  Does this apply to the Goldbach conjecture?  If not why not?  What am I not understanding here?


Adjective for Person Who is from The United States

Someone from Taiwan is Taiwanese. Someone from Brazil is Brazilian. Someone from Israel is Israeli. What is someone from The United States called? Is someone from The United States called United Statesian?


Show that $$19\mid 12^{2013}+7^{2013}$$$$$$No use of modular arithmetic, have not come this content.


Fastest way to parse XML String into org.w3c.dom.Document

This code is very slow:  DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); dbFactory.setNamespaceAware(false); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();  org.w3c.dom.Document doc = dBuilder.parse(new InputSource(new StringReader(content))); System.out.println(doc.toString()); // outputs [#document: null]   And not only that it's slow it does not even parse:  <!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"> <en-note>

     <en-media hash="" type="application/octet-stream" />

This is my first Evernote blog with image/photo attached.

This is another line.

Some          formatting also for          some lines.
 </en-note>   What is the fastest way to parse this XML into a org.w3c.dom.Document?


In OSX 10.10 there was an option to go to Finder > Empty Trash or Finder > Secure Empty Trash  In OSX 10.11 there now only seems to be an option for Finder > Empty Trash  Any ideas way i can get it back ?


What do for upgrade from ubuntu 19.04 to 20.04 and if don't work repository on 19.04

I don't answer on problem with repository and upgrade to ubuntu 20.04 because I am a new user and I write this post how a ask. First if don't work repository on 19.04 need change it. How do: in etc/apt/sources.list change all active repository to another address: . then in terminal sudo apt update.  For upgrade from ubuntu 19.04 if you changed correct repository  you need change address to . And then upgrade. All these change need does this root privileges. In terminal: su then password then nautilus. If you don't have root account do it : sudo passwd    then new enter password for root. Sorry for my english.