Travelling before and after 30 day grace period of J1 Visa

I'm in a bit of a pickle. Due to miscalculation, I'll be entering 31 days (instead of 30 days) before the start of my J1 program. I also leave 5 days after the 30 day grace period after the end of my J1 program.  My question is:  Will I be able to enter U.S. under VWP (I have an Australian Passport), and during the month before my program start I intend to travel the West Coast up to Cananda, and then re-enter on my J1 visa.  Similarly, after the end of my program, during the grace period, I intend to travel East Coast up to Canada and then re-enter under the VWP program such that I can leave the U.S. a few days after my grace period finishes.


When I use a figure command to insert an image , I notice that the image does not go where exactly I want , and even when I want it in a specific subsection I find it before that section  \begin{figure}  \label{fig:f43} \caption{An Example } \includegraphics[width=12cm, height=6cm]{4-12}  \end{figure}


I've been playing Dota for at least a year and always seem to run into trouble laning mid against a good Bloodseeker (one that can last-hit/deny well).  Even if I try to harass him, he will STILL last-hit/deny his way through the damage and eventually reach a quick lvl 6.  Not to mention I'll likely draw creep aggro.  Any good advice on countering Bloodseeker mid?


RegEx for Phone number +0 (000) 000-00-00

I have to validate a contact form sent from my site. Contact number is set as follows : +0 (000) 000-00-00  Which RegEx i should use for this form validation? This one is not correct: var phoneReg = /^\+\d\\(\d{3}\))\d{3}-\d{2}-\d{2}$/ Thank You


Is there an advantage to linear chromosomes?

The DNA copying enzymes have a hard time working to the end of a chromosome. For circular chromosomes this is not a problem, since there is not a sharp 'end'. However, for a linear chromosome, without extra mechanisms in place, a bit of DNA is lost off the end of the chromosome after each replication. Because of this, eukaryotes have a  to cap off their chromosomes. In most cells of a mutli-cellular organism, this telomere is slowly worn away after each reproduction leading to . Cells that need to reproduce indefinitely such as germ and stem cells have to invest in extra mechanisms to replenish the telomere. For multi-cellular eukaryotes I can see how this might be usefull (for instance as a cancer counter mechanism). However, multi-cellular organisms evolved from single-cell eukaryotes. I cannot see a reason for wanting apoptosis in a single-cell organism. However, single cell eukaryotes (say yeast) still have linear chromosomes with telomere caps. What advantage did linear chromosomes provide single-cell eukaryotes to offset the extra investment in reparing the telomere?  Related questions


Switching from Ubuntu to Windows 7 help?

I switched from windows 7 to Ubuntu 12.04 LTS a week or so ago on my Toshiba Satellite L755 I believe. It worked fine, but I had Internet problems and internal errors so I thought switching to 12.10 would fix everything, I was wrong.   Long story short, I want to switch back to windows 7 but when I installed over windows 7. I don't have a recovery CD because, can I create a recovery CD on another computer and use that?  Thanks Terry and everyone else who answered!  I was able to restore my computer using a back up from when I had Windows 7 so if all goes well I'll be set.


How to grab output from command in shell script

I'm trying to write a shell script in RHEL which will execute grub-md5-crypt and the user will type their password.  Now the problem is how can I grab the encrypted md5 hash displayed to the user in the shell script?  I tried to figure this out but command redirection will not work here.  So how can I get the md5 encrypted text in the shell script after the script has executed grub-md5-crypt?


I am travelling to the US via LHR on an Indian passport. I have a 10+ hour layover in LHR (land at 06:30 and take off at 17:00) with both flights from T5.  I was wondering if anyone has had experience with the UK transit without a visa program. I meet all the conditions but the website says that granting this waiver is at the discretion of the interviewing officer. So I'm looking for real-life experiences here. I haven't had the time to apply for a transit visa and I'm really hoping to get a chance to take some rest at a hotel near the airport and get a nice meal in.  This is my second trip to the US and I have also been to the UK twice before: once as a visitor and the second when my flight back from the US was delayed.


I have Ubuntu 16.04 and every time I try to install an app using the terminal (e.g. apt-get install git,) I get this message:  dpkg: error: requested operation requires superuser privilege W: Could not open file '/var/log/apt/term.log' - OpenLog (13: Permission denied) E: Sub-process /usr/bin/dpkg returned an error code (2)   So I executed sudo apt-get install git and I got this:  sudo: error in /etc/sudo.conf, line 0 while loading plugin 'sudoers_policy' sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner sudo: fatal error, unable to load plugins   How do I fix this?


Does my visa name have to match my name on my passport to enter the US

I recently just obtained my visa to enter the US. I'm a Mexican with a Mexican passport. My name on my passport is as follows: First Name: Maria Second Name: de Lourdes.   My name on my visa is: First Name: Maria Second Name: Lourdes.   My question is if I will have trouble entering the US because one says "Maria de Lourdes" and the other document says, "Maria Lourdes". The last names appear the same, my issue is only with the 2nd name.


If you end a question with a proper noun that requires quotation marks, i.e. a play's name, do you still put the question mark (?) inside the quotation marks?  EXAMPLE: Did you see "South Pacific"? -or- Did you see "South Pacific?"


Can we declare an interface class by making all the methods abstract using the keyword ‘abstract’ in a class in C++?

I want to know about the way of defining interface class in C++ by this approach. Is it possible? I don't want to know about interface creation but want to know about the abstract keyword use in C++.


How can I determine which Ubuntu distribution support Kernel 3.16?  Is there a table or spreadsheet link somewhere which list ALL of the various Ubuntu distributions to date and the Linux Kernel versions they support? Thanks...


The question is:  Let $\phi ： \mathbb{R}^n \to \mathbb{R}^n$ be a $C^1$ map and let $y = \phi(x)$ be the change of variables. Show that $$dy_1\wedge\dots\wedge dy_n = (\operatorname{det}D\phi(x))\cdot dx_1\wedge\dots\wedge dx_n.$$  I tried $n = 2, 3$ but still didn't get any rule. Do we need to do this under integral?


Problems when using IIS SMTP Pickup Service

In my website, I send emails from my website to IIS SMTP Server (using the pickup drlivery method). IIS SMTP server is set up to forward the emails to a local mail server, XMail Server, running on the same machine (using the smart host setting).  This configuration works great, no problems here. The problem I'm seeing though is that emails sent from my website get deleted by some webmail providers (like AOL) or end up in the spam folder (which what happens with Hotmail). I have everything set up correctly to avoid problems with their spam filters (SPF record, reverse DNS resolves to the same IP .. etc), still my messages are not delivered to the user's inbox.  Now, by checking the generated message headers, I see that the IIS SMTP Pickup service adds its headers before forwarding the message to XMail server, is this why my messages get deleted by AOL and flagged as spam with hotmail? Other than sending the emails directly from my website to XMail, is there anything to do to make it work with the current configuration?  Here are the message headers for a message sent from my domain (please note that my real server's IP, domain name and computer were replaced):  Delivered-To: urshad8987@gmail.com Received: by 10.142.234.17 with SMTP id g17cs544432wfh;         Mon, 18 Jan 2010 05:45:09 -0800 (PST) Received: by 10.142.66.27 with SMTP id o27mr3223385wfa.216.1263822309298;         Mon, 18 Jan 2010 05:45:09 -0800 (PST) Return-Path:  Received: from computername (mydomain.com [1.1.1.1])         by mx.google.com with ESMTP id 39si10419762pzk.116.2010.01.18.05.45.08;         Mon, 18 Jan 2010 05:45:09 -0800 (PST) Received-SPF: pass (google.com: domain of confirm@mydomain.com designates 1.1.1.1 as permitted sender) client-ip=1.1.1.1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of confirm@mydomain.com designates 1.1.1.1 as permitted sender) smtp.mail=confirm@mydomain.com Received: from computername ([127.0.0.1]:51518)     by computername with [XMail 4.7.1.imap4.dk-i ESMTP Server]     id  for  from ;     Mon, 18 Jan 2010 05:45:07 -0800 Received: from mail pickup service by computername with Microsoft SMTPSVC;      Mon, 18 Jan 2010 05:45:07 -0800 MIME-Version: 1.0 From: MyDomain  To: urshad8987@gmail.com Date: 18 Jan 2010 05:45:06 -0800 Subject: MyDomain Account Confirmation Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID:  X-OriginalArrivalTime: 18 Jan 2010 13:45:07.0070 (UTC) FILETIME=[71F721E0:01CA9844]  Hi,=0A=0AYou recently registered for MyDomain. Please confirm your=  account by clicking this link:=0Ahttp://www.mydomain.com/confirm.aspx?memberid=3D111&vcode=3D6ca78bb81a464f11a59fbdff69f8459b= =0A=0A=0AThanks,=0AThe MyDomain Team


Can one observe a blackhole grow from outside its event horizon?

For an observer outside Black hole's event horizon nothing ever falls into the black hole .  So if the observer waits for an eternity outside a super massive blackhole feeding on gas , will the observer ever see the blackhole grow in size expanding its event horizon ?


How To Set Default Wallpaper As Login Screen Wallpaper [Automatically]?

I`m Unable To Set The Login Screen Wallpaper Of My Custom Wallpaper Is There Any Working Tool Which Changes Easily Without Any Bugs


How can I see the source code on a suggested edit review page?  I want a similar thing as in  for .


I was going through my old code and I stumbled upon some strange behaviour.  Folder and files inside it are chowned to me, however I am not allowed to enter it, or even list its content. Unless ofcource I am a root user.  Here is a screenshot. Could you please explain ?   GNU coreutils : 8.25, OS : Ubuntu 16.04.2 LTS


What quantum mechanical effect allows light to gain it's speed when it moves from another medium back into air/vacuum?

According to refractive index's formula, we say that speed of light is other mediums is smaller than that of speed of light in air/vacuum. What quantum mechanical effects govern the increase in speed of light when it moves from another medium back into air/vacuum?


Recover the package manager after crash during update

My so frequently crashing 12.04 system responded with a kernel freeze during my last package update. Which did result in malfunction Package Manger that describes the error as such: "Error:BrokenCount>0"...  Can the package manager be recovered in some way?


Shouldn't we also see our galaxy clusters in that ring just beyond the shadow of M87?

I read that the image of the shadow taken by EHT is actually all the surfaces of the event horizon of M87 which extends to 2.6 schwarchild radius but wouldn't that also meant that we can also observe our galaxy clusters in that photonsphere which is the ring that is just beyond the 2.6 schwarchild radius, by the way I am not confused with the bright coffee mug stain like ring which extends out from 3 schwarchild radius which is supposed to be the falling matter around the blackhole. My question is can we see ourselves in the photonsphere?


If $x,y$ are Positive integers such that $3x^2+x=4y^2+y$ Prove that $x-y$ is a Perfect Square  My try:  We have $$3x^2+x-(4y^2+y)=0$$ a Quadratic in $x$  So $$x=\frac{-1+\sqrt{1+12(4y^2+y)}}{6}$$  This implies $48y^2+12y+1$ should be a perfect Square say $m^2$  $$48y^2+12y+(1-m^2)=0$$  Whose Discriminant is $144-192(1-m^2)=192m^2-48$ should be a Perfect Square say $p^2$  So  $$192m^2-48=p^2$$  Any way further?


I am using a function to open a first file and to copy the content to another one with some changes. First I look for a symbole that I want to do some changes before it, my problem is that the function is looking for all the same symbole and make changes before all of them. I want from the function to only look for the first occurance of the symbole and to make changes. here is the code:  public static void Trouver(String theInputFileName, String theOutputFileName, String theSymbol, String theExpression ){      int m_IndexDebut = -1;     String m_TmpStr  = null;     String m_OutputString   = "";     boolean m_found = false;      RandomAccessFile m_InputFile = null;     RandomAccessFile m_OutputFile = null;     String m_Ligne = null;     String m_xref = "xref";     try{         // Ouverture du fichier         m_InputFile = new RandomAccessFile(theInputFileName, "r");         m_OutputFile = new RandomAccessFile(theOutputFileName, "rw");          // Lecture Ligne par Ligne         while (  (m_Ligne = m_InputFile.readLine() ) != m_xref ){              // Initialisation de l'index pour une nouvelle ligne             m_IndexDebut = -1;             m_found = false;             m_OutputString = "";             m_TmpStr = m_Ligne;              // On Cherche le "symbole" et on ajoute ce qu'on à ajouter             while ( m_TmpStr != theSymbol && (m_IndexDebut = m_TmpStr.indexOf(theSymbol)) != -1 ){                  m_found = true;                 m_OutputString = m_TmpStr.substring(0, m_IndexDebut).concat(theExpression).concat("\n").concat( theSymbol );                 m_TmpStr = m_TmpStr.substring(m_IndexDebut + theSymbol.length() );              }              // Ajout de la fin de la ligne               if ( m_found )                 m_OutputString = m_OutputString.concat("\n");             else                 // Si aucun symbole trouvé ,Réecriture de la ligne                 m_OutputString = m_Ligne.concat("\n");              // Ajout de cette ligne au fichier sortant             m_OutputFile.write( m_OutputString.getBytes());         }      }catch (IOException e){         System.err.println("IOException : "+e.getMessage());     }finally {         // Fermeture des fichiers         try{             m_InputFile.close();             m_OutputFile.close();         }catch ( Exception e ){          }     } }


Why won't the if statement execute in my for loop?

The method I'm hoping to execute doesn't acknowledge whenever a "y" is inputed into the scanner. It doesn't execute the first part of the if statement, it immediately skips to the else. I'm not sure why it isn't working, is it because I have several scanners running at once? The goal is to use the for loop to store several answers into an array and then manipulate the array with another method. any help to why would be great!       private static float[] assignMarkArray = {0,0,0};       public static void setAssignMark(int index, float value) {         assignMarkArray[index] = value;     }      public static void setLabMark (int index, float value) {         labMarkArray[index] = value;      }      public static void enterAssignGrades() {     System.out.println("Do you have any assignment Marks? (y/n)");     Scanner sc = new Scanner(System.in);     String input = sc.nextLine();     if (input == "y"){         for(int q = 0; q < 3; q++) {             System.out.println("Do you have a mark for A" + (q+1) + "(y/n)");             Scanner sc2 = new Scanner(System.in);             String input2 = sc2.nextLine();             if (input2 == "y") {                 System.out.println("Enter your A" + (q+1) + " mark (Out of 100%): " );                 Scanner sc3 = new Scanner(System.in);                 float gradeInput2 = sc3.nextFloat();                 setAssignMark(q, gradeInput2);              }else if (q==3) {                 sc.close();                 sc2.close();             }             else{                 setAssignMark(q, 0);             }         }     }     else{ System.out.println("There are no assignment grades to mark");           sc.close();     } }


How can I change the default boot text (Ubuntu 14.04) to custom text?

I am wondering how to change the text that displays "Ubuntu 14.04 . . . ." on boot to a custom text.   Edit: I am talking about the ASCII text during the boot process, not the Ubuntu logo.


I have a massive log file which breaks the 2Meg limit and hence truncates.  There is some information I need that I am logging by doing  System.debug   However, I don't get to see because of the logfile truncation.  I change the logging settings so that everything is logged at ERROR except apex code but this still does not bring logging under 2 Meg.  Any ideas?  Thanks.


Can I install Ubuntu from an ISO file on Windows?

I've mounted the ISO file using a virtual drive application. When I open the virtual drive with the Ubuntu ISO mounted, I only have the option of restarting to be able to do anything. However, I couldn't boot from the ISO after restarting.  Is it possible to boot from a mounted ISO file from the first place? Or do I have to burn the image and boot from the physical CD?


Can't add a specific WMS on Leaflet which worked on QGIS

I am learning to use Leaflet. I tried to add a layer from  . My code looks like this:  var wms = L.tileLayer.wms("https://wms.nlsc.gov.tw/wms", {     layers: 'EMAP2',     format: 'image/png', }).addTo(map2);   But the layer didn't show on the map. When I checked what is being returned by the developer's tool, I found they were xml files and not images! So this may be the problem, but I don't know how to fix it. Other things I've tried:   Checking with another layer, "CITY". Doesn't work. Still no layer is showing. Check if something is really wrong with my code by trying to load a layer from another source by changing the url to "", and layer to "OSM-WMS". This works! Check if something is something is wrong with the coordinates by loading the 'EMAP2' from the first source and "OSM-WMS" layer from the second source in QGIS. I set the CRS to EPSG:3857 for both. This works! They overlay just fine. Check what request the browser is sending using developers tool. For the "EMAP2" layer, this is a sample of what is being requested (as there are multiple request):


display wrapper class list of account records?

Hi I am trying to display list of account records and display total count in output text using remote action method for that I created one wrapper class and did some code but I am not getting records from wrapper account.  what I am getting when using alert(result)  Controller:  public class exremote {     public static list<account> listacc{get;set;}     public static integer count{get; set;}      @remoteaction     public static wrappercls getaccounts(){         string account = 'select id,name,accountnumber from account';         listacc = database.query(account);         count = listacc.size();         system.debug('#####'+count);         wrappercls wra = new wrappercls(count,listacc);         return wra;     }      public class wrappercls{         public integer count11;         public list<account> account;          public wrappercls(integer count11,list<account> account){             this.count11 = count11;             this.account = account;         }     } }   page:  <script>   function getallaccounts(){     exremote.getaccounts(         function(result,event){             if(event.status){              }             else {              }        },{escape:true}     ); } </script>


Incorrect whitespaces or list item size in Android SE app

Noticed that sometimes when there are 10+ answers to a question - some answers look like they have \n\n...\n line breaks in the end, so the body of the answer has incorrect height.  It probably has something to do with ViewHolder or adapter not setting correct row height. Although as far as I know, it should do this according to text amount/length.


yesterday I installed Ubuntu 13.10, and since I rebooted my laptop, there is a user account called Light Display Manager as available option on my login screen.  A password is needed for login, but I don't know it, although I tried some.  Because of some answers I modified with sudo power one file as follows (added lightdm):  cat /etc/lightdm/users.conf  # # User accounts configuration # # NOTE: If you have AccountsService installed on your system, then LightDM will # use this instead and these settings will be ignored # # minimum-uid = Minimum UID required to be shown in greeter # hidden-users = Users that are not shown to the user # hidden-shells = Shells that indicate a user cannot login # [UserAccounts] minimum-uid=500 hidden-users=nobody nobody4 noaccess lightdm hidden-shells=/bin/false /usr/sbin/nologin   → But it didn't changed anything!  What is this? Why is this there? How can I remove (if it's unnecessary)? Thanks in advance for an answer!


Install ubuntu in a endless so installed pc

I bought a laptop with endless O.S. and I'm trying to install ubuntu on it, however, ubuntu installer doesn't run (it keeps in loading menu for a long time and doesn't start ubuntu's installation). Can someone help me?


Multiple Python objects unintentionally sharing reference

Issue  I am declaring a set of companies and dates per company, for some reason whenever I update one of the months for a company, the same month for every company gets updated.  Simplified code snippet  class Company:     rating = dict()  class Month:     score = 0     scoreCount = 0  ...  rating.company = "Google" rating.date = "Nov2018" rating.score = 5  if rating.company not in companies:     companies[rating.company] = Company()  if rating.date not in companies[rating.company].rating:     companies[rating.company].rating[rating.date] = Month() ...  companies[rating.company].rating[rating.date].score += rating.score companies[rating.company].rating[rating.date].scoreCount += 1   Using python3.5  Case scenario  companies["Google"]["Nov2018"].score = 0 companies["Microsoft"]["Nov2018"].score = 0   Then, when I update the score of one of the two months using the snippet above, the other one is also updated  Expected behavior  Only one of the two Month objects updates after each iteration  Here you can see how both Month objects share the same reference although they're under different companies and declared separately.


What do the various showing options of the different tabs actually show exactly?

In thinking and reasoning about the new question navigation bar and trying to figure out where unnecessary and necessary redundancies are and what could be improved, I more often than not stumble across the problem that I don't really know what all those different options actually do, and neither of the two iterations of that official announcement question seems to completely explain it. I feel that any further question I'd ask might simply be an XY problem of not knowing what I want to improve at all. It might be clear to people deeply acquainted with the old navigation bar already what e.g. "recommended" actually means, but there are also other sub-options that seem to .  So hands down, what are the exact technical criteria (i.e. votes/answers/views whatever) that all the different tabs and their filtering/showing sub-options employ for filtering questions? I know what the tag filters do, or what the time filters in the "popular" tabs do, but especially some "show" options are a bit unclear to me, and others might be clear but I'd still like to have it canonically answered to be sure. In particular I'm having problems grasping the following options:  "new" tab   show: all vs show: recommended - That doesn't seem to filter only my favourite tags (for which there's a separate filter anyway), so what is recommended at all?   "popular" tab   sort: hot - Does this use the "arbitrary hotness points" of the HNQ or another hotness formula, or even other criteria in addition?   "need answer" tab   show: need answer vs show: no answer - I figure those are the good old "no accepted/upvoted answers" vs "no answer at all" options. But do they use additional criteria? I'm asking because some of the  in the old design had the unexpected behaviour of excluding negatively voted questions. show: all - What does this actually show? It seems to include questions with accepted answers, but how does it then differentiate from the show: all view in the "new" tab? Or maybe this even is absolutely intentional redundancy for easier usability?


Show that $\sqrt{2+\sqrt{2+\sqrt{2...}}}$ converges to 2

Consider the sequence defined by $a_1 = \sqrt{2}$, $a_2 = \sqrt{2 + \sqrt{2}}$, so that in general, $a_n = \sqrt{2 + a_{n - 1}}$ for $n > 1$. I know 2 is an upper bound of this sequence (I proved this by induction). Is there a way to show that this sequence converges to 2? What I think is that the key step is to prove 2 is the least upper bound of this sequence. But how?


How to delete variable with names starting with certain character(s) in Python IDLE

In Python IDLE, is there a way to delete variables with names starting with certain character(s) from memory, equivalent to Matlab's clear t* that removes all variables with names starting with t from the memory?


Difference between had survived, has survived and survived

Is it she had survived, she has survived or she survived? Thanks. Edit: In one scenario, she's dead, and in another one, she is still alive. Is "There is no way she could have had survived the attack." - even though she has survived back then, she's now dead from old age. "There is no way she could have survived the attack." She is still alive. Can we use just survived in the past simple? Wouldn't that be incorrect because if she had survived, well then there still would be effects in the present (the effects are that she's alive), shouldn't we go with the present perfect?


Subwoofer hums when no audio source is connected

The hum stops as soon as an audio source is connected or any metal part of the subwoofer is connected to the ground of a socket. Does anyone have any idea what the problem is?


pop-up ads appear even when using ad block

I am using ABP ad-block extension of google chrome on my windows 8.1 laptop. But it doesn't work. Useless pop-ups appear out of no-where. Even if I click anywhere on the screen these pop-up ads appear.The ad blocker shows how many ads it has blocked but doesn't prevent these pop-ups from appearing. I want to know the possible reasons behind this or is there some problem with the browser and ad-block compatibility? Because I am using the same ad-blocker extension on chrome browser in my macbook air.  Thanx in advance!!


Why is correlation formula the way it is? Or Say how it formed?

I am really being confused by why the correlation formula is called the correlation of two variables $X$ and $Y$. Also how is it derived?   The part where we divide covariance by product of standard derivation of $X$ and standard derivation of $Y$ is the most confusing for me. Please explain the reasons or provide some good source for such things.


Can a US citizen work remotely for a US company while in Japan for sightseeing?

Assume a US citizen works for a US company remotely and that this person has a passport, but no visa.  Let's say they want to go spend some time in Japan for leisure/tourism/sightseeing - no more than 90 days, but still long enough to require them to take their work laptop and do their US-based job while they're there.  Is this allowed?  My understanding is yes, even if their passport is stamped for tourism and sightseeing, as long as it's not for a Japanese entity, and as long as they're back out within 90 days.  However I had somebody reading some of the same material I was a little while back and understanding it differently.  What's the truth in this case?  Unless I'm mistaken, this seems to suggest that work can be done for 90 days, without a visa, but it is not clear about trying to do it while you're acting like a tourist:     A visa is NOT necessary for US passport holders visiting Japan for a short-term stay of less than 90 days with the purpose of tourism and business.   src:


doubt on taking vertical pitch for dip packages

I have one doubt on taking terminal row spacing from this below picture. In this picture, which one have to take — eB or E?


Why did David kill someone he seemed to care for?

After watching Alien Covenant, it was not clear as to why David would kill Elizabeth?  David was obviously a nutter, yes, but in my interpretation of the film he really cared for Elizabeth.


Can I ask a technically solved question for better advice?

While browsing through some questions, I was reminded of a problem I encountered in an earlier point in work. I came up with something that could be technically called a solution to the problem, but I can't really say I am satisfied with it. I thought about asking the question on SO.  In effect, the question would read something like a more detailed version of "This was my problem. This is how I currently solved it. Is there a more appropriate/efficient method of accomplishing this goal?" I'm a bit unsure as to whether it'd be an appropriate question since it technically already has an accepted answer, especially if there is no "more appropriate/efficient method", then it seems questionable why I would even ask in the first place.  So, should I ask this kind question? On a related note, would it be better etiquette to include my current solution as part of the question body, or should it be appended as an answer?  Update  I am accepting quack's because . But I find all of the answers given to have been satisfactory, and a good learning. Thanks to everyone!


When I try updating my system this error pops up.  Can anyone help?  E: Failed to fetch http://ppa.launchpad.net/pasgui/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages


Find all $n\in\mathbb{Z}^+$ such that the sum of the digits of $5^n$ equals $2^n$   Starting with a table of values, I found that $n=3$ works. Beyond this, it's hard to imagine any other number working. As $n$ gets larger, it seems to me that $2^n$ grows far more rapidly than the sum of the digits of $5^n$ would ever be able to "catch up" to.  My reasoning: multiplying by each $2$ doubles $2^n$, but multiplying by each $5$ adds (I think) at most $1$ digit to $5^n$, which would add at most $9$ to the sum of the digits of $5^n$. Another way of looking at it, suppose $n=1000000$. Notice that $5^{1000000}<10^{1000000}$, which is $1$ with $1000000$ zeros. Thus $5^{1000000}$ has at most $1000000$ digits, and the sum of its digits would be maximized if those digits were all $9$s. Then the sum of the digits of $5^n$ would be $9\cdot1000000=9000000$, which is far less than the number $2^{1000000}$.  But is there a way to prove this using theory?


Python is an interpreted language. So, when we submit the code to end users, will they get the source code or the executable one? If a user gets the source code of the application, it may be tampered with. So how is safety measured in Python applications?


How do I shrink a dynamically growing VDI disk from VirtualBox?

My dynamically growing virtual disks (VDI) from various Ubuntu installations in Virtual Box are actually steadily "growing" indeed.  Deleting of files in the virtual machine does not free the space my VDI file took from the host hard disk space.  How do I shrink these files to give the unused hard disk space back to the host?


Computer does not boot after changing hdd and reverting back

1) I have an existing HDD in my computer that dual boots linux and windows using the traditional bios way.  2) I then took out the existing HDD and swap in a new HDD to install linux on it with uefi. It boots and reboots fine.  3) I took out the new HDD with uefi linux and put back the old HDD with bios dual boot. Old HDD boots fine.  4) I swap the old HDD with the new HDD that has uefi linux on it and it refuses to boot.  bootloader is grub for both HDD  Any ideas on what could be the problem and how to solve it?  Aside, what I am experiencing is similar to this link:   which says     This is how some UEFI vendor implementations (ex. HP) will no longer recognize the drive as bootable through UEFI if you have made hardware changes, even though it worked prior to the switching, and you switched it back to the original configuration.


Can expectation maximization be used to optimize a quadratic function?

My knowledge about Expectation Maximization (EM) is limited, from my understanding, EM is just an algorithm to do optimization. It works well when we have some hidden / latent variables, such as Hidden Markov model or Mixture of Gaussians.  On the other hand, I learned many other continuous optimization algorithms such as gradient decent, newton's method, etc.   So what is the relationship between EM and these continuous optimization algorithms? And is that possible for anyone to give me an example of using EM in a quadratic optimization  $$ \min \mathbf x^\top A \mathbf x $$


Why do we use microwaves in microwave oven?

We know that any object above absolute zero emits electromagnetic radiation. So hotter the object shorter the wavelengths. In the electromagnetic radiation spectrum radio waves has the longest then microwave, then infrared, then visible light, then ultraviolet, then x-ray, then gamma rays. Why do we use microwaves in microwave oven when infrared and visible light are much hotter and how do microwaves cook food when they are cooler than visible light and others.


How can I rewrite to my .htaccess in PHP?

How to rewrite my URL from http://www.mysite.com/listingsecond.php?ID=1 to http://www.mysite.com/listingsecond?  How can I rewrite to my .htaccess in PHP to do this?


Distribution of $(XY)^Z$ for $(X,Y,Z)$ i.i.d. uniform on $(0,1)$

Let $X$, $Y$ and $Z$ be i.i.d. uniform (0,1) random variables. What is the distribution of $(XY)^Z$? I've tried to solve it via mgfs, and what I've found is:  $$E\left(e^{(XY)^Z}\right)=E\left(E\left(e^{(XY)^Z}|Z\right)\right)$$ $$=E\left(E\left(e^{(XY)}\right)^Z\right)$$ $$=E\left(2\left(\frac{e^t-1}{t}\right)^Z\right)$$ $$=2\int_0^1\left(\frac{e^t-1}{t}\right)^zdz$$ $$=2\int_0^1\exp\left({z\log\left(\frac{e^t-1}{t}\right)}\right)dz$$ $$=2\left[\frac{\exp\left({z\log\left(\frac{e^t-1}{t}\right)}\right)}{\log\left(\frac{e^t-1}{t}\right)}\right]_0^1$$ $$=2\frac{{\frac{e^t-1}{t}}-1}{\log\left(\frac{e^t-1}{t}\right)}$$  But I don't see where to go from here. It doesn't look like the mgf of any distribution that I know. How can I determine the distribution from this, or is there another way?


I have been doing some research for a while on dual booting, often when I see pages or documentation on it, they have several partitions, and I have one. The one partition I have is ext4, it has plenty of room. But it's mounted, I spent all my money on buying windows 10 to dual boot with my Ubuntu GNOME, IT would be great if I could resize it without mounting it? If you can do it safely with it mounted then I will be happy to do that, if it would be less of a struggle and risk I am open to somehow removing Ubuntu to put windows on. Thanks in advance!


Is a "local enough" class number always equal to one?

Let $F$ be a number field, and $\mathcal{O}$ its ring of integers. Is there always a finite set $S$ of places of $F$ such that $\mathcal{O}_S$ has class number one? Is it a consequence of standard results on class field theory or is it something else?


Just learning Omega 3 and 4 is out so I'm switching to try it out, but.. how does one install a subtheme manually? My drush is whacked and I already running multiple installs so I just want to do it manually.  However, copying the "default" folder to the sites/all/themes/ folder... there is no info file... so I duped the one in Omega, changed the name and it shows in the Appearance menu. However, the name isn't correct and I've gone through the few files to see what to change to my themes name but there was only one file.  So, I enabled one, it enables, but then when I click "Settings" next to that theme, I get the WSOD.  Seems not to be the same process as in D6 or even Omega 3. Anyone installed a subtheme of Omega 4 yet manually?


Proof that ladder operators contains a complete set of eigenkets

Ladder operators, in quantum mechanics, could be used to derive eigenkets of energy with different eigenvalues (i.e. the system's energy) by raising and lowering it.  However, is there a proof that it proves a COMPLETE set of eigenkets?


When replacing non-grounding type receptacles is a GFCI receptacle required, or can any GFCI device be used?

Under the NEC (it was 210(7)(d)(3), but appears to have moved around some), it is permissible to replace an ungrounded receptacle with a GFCI receptacle, then wire further ungrounded or non-grounded (i.e. a NEMA 5 without a ground wire hooked up) receptacles on the circuit to the load side of the GFCI, all in lieu of running a ground wire in order to replace the existing ungrounded receptacles with grounded receptacles.  However: does this permission extend to replacing the branch circuit overcurrent protection device with a GFCI-type circuit breaker (or a CAFCI breaker that provides ground fault protection for personnel)?  Or can only GFCI receptacles be used for this retrofit? The NEC's verbiage does not make mention of breaker-type GFCIs...


Sum of the reciprocals of divisors of a perfect number is $2$?

How do I show that the sum of the reciprocals of divisors of a perfect number is $2$?   I tried $d_i\mid n$ with $i\in\mathbb{N},\;d_i\leq n$ then $$\frac{1}{d_1}+\frac{1}{d_2}+\frac{1}{d_3}+...+\frac{1}{d_i}=2$$ $$\sum_{d\mid n} \frac{1}{d}=2$$  So actually, I have to show this last equality, whereas $n$ is a perfect number.


I have a program in c# that has a dictionary, I defined it like this:  Dictionary dict<Int32,Int32> = new Dictionary<Int32,Int32>();  Then I added 100 entry to my dictionary. Now I want to know the exactly memory usage of this dictionary.  please do not talk about sizeof and some methods like this, I want a mathematical way to compute it, for example if there is any pointer or any hash key that should be saved, please let me know (actually I do not know the exact way that dictionary works).


Show that $n$ can be written in the form $n=c_{0}+c_{1}d+...+c_{k}d^{k}$

I day ago, i've been solving some induction exercises from my textbook. But when i saw this, it seems a bit tricky and i couldn't come up with a solution. I hope someone can give clarity for this. Thanks! Let $n$, $d$ positive integers and assume $1<d<n$. Show that $n$ can be written in the form $$n=c_{0}+c_{1}d+...+c_{k}d^{k}$$ with $0≤c_{i}<d$, and that these integers $c_{i}$ are uniquely determined. I first proved the uniqueness of $n$ using Euclidean-Algorithm with $n=qd+c_{0}$ what i am troubling now, is how will i conclude this finding to show that $n$ can be written on that form?


"take your hat off" vs "take off your hat"?

Which would be the correct word order and why? Is there a generic rule that can be used with similar constructs (verb + preposition)? If yes, what is it called?


I am self-studying Gibbs sampling from a book. The book introduces metropolis hastings algortihm to generate representative values from a posterior distribution. So we know $p(D | \theta) p(\theta)$ but not in the normalized form. So we generate those values.   Now when it introduces Gibbs sampling it quotes,      Gibbs sampling is especially useful when the   complete joint posterior, $p(θ_i |D)$, cannot be analytically determined   and cannot be directly sampled, but all the conditional distributions,   $ p(θ_i |\{θ_{j \ne i}\}, D)$, can be determined and directly sampled.   Suppose we have two parameters $\theta_1$ and $\theta_2$ so for determining $p(θ_1|θ_2, D)$, we need $\frac{p(θ_1, θ_2|D)}{p(θ_2|D)}$, and now I am all the more confused. First it says      when we can't analytically determine the posterior   and then uses  $\frac{p(θ_1, θ_2|D)}{p(θ_2|D)}$ , where we don't know yet the posterior distribution, because that is not "analytically determined". Can anyone explain, what am I understanding wrong.


NPE - Attempt to invoke interface method 'int android.database.Cursor.getCount()' on a null object reference while executing doInBackground

1.MovieDetailsFragment     @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {     if (mMovie != null) {         inflater.inflate(R.menu.menu_detail, menu);         Log.d(LOG_TAG, "detail Menu created");          final MenuItem action_fav = menu.findItem(R.id.action_fav);         MenuItem action_share = menu.findItem(R.id.action_share);          //set proper icon on toolbar for favored movies         new AsyncTask<Void, Void, Integer>() {             @Override             protected Integer doInBackground(Void... params) {                 return Utility.isFavored(getActivity(), mMovie.getMovie_id());             }              @Override             protected void onPostExecute(Integer isFavored) {                 action_fav.setIcon(isFavored == 1 ?                         R.drawable.ic_favorite_black_24dp :                         R.drawable.ic_favorite_border_black_24dp);             }         }.execute();     } }   2.Utility      public class Utility { //takes movie_id and tells whether or not that movie is favored public static int isFavored(Context context, int id) {     Cursor cursor = context.getContentResolver().query(             MovieContract.FavEntry.CONTENT_URI,             null,   // projection             MovieContract.FavEntry.COLUMN_MOVIE_ID + " = ?", // selection             new String[] { Integer.toString(id) },   // selectionArgs             null    // sort order     );     int numRows = cursor.getCount();     cursor.close();     return numRows; }   Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int android.database.Cursor.getCount()' on a null object reference                                                                                at com.example.deepankmehta.popularmovies2.Utility.isFavored(Utility.java:20)                                                                                at com.example.deepankmehta.popularmovies2.MovieDetailsFragment$1.doInBackground(MovieDetailsFragment.java:108)                                                                                at com.example.deepankmehta.popularmovies2.MovieDetailsFragment$1.doInBackground(MovieDetailsFragment.java:105)


Proving that two vector spaces of equal dimension are isomorphic

Given the following problem     Let $U$ and $V$ be finite dimensional vector spaces, such that $\dim(U) = \dim(V)$. Prove that $U$ and $V$ are isomorphic.   I was just wondering if somebody could critique and validate my proof.  Proof  Two vector spaces $U$ and $V$ are isomorphic if and only if there exists a bijection $\phi: U \to V$. That is, an invertible linear map between the two. Let $\dim(U) = \dim(V) = n$ and let $\left\{u_1, \dots, u_n\right\}$ and $\left\{v_1, \dots, v_n\right\}$ be bases for $U$ and $V$, respectively. It follows that any vector $u \in U$ can be written as  $$ u = c_1u_1 + \cdots + c_nu_n $$  We define $\phi: U \to V$ as  $$ \phi(c_1u_1 + \cdots + c_nu_n) = c_1v_1 + \cdots + c_nv_n $$  Observe that $\phi$ is invertible. That is, given a vector  $$ v = d_1v_1 + \cdots + d_nv_n $$  in $V$, we define $\phi^{-1}: V \to U$ as  $$ \phi^{-1}(d_1v_1 + \cdots + d_nv_n) = d_1u_1 + \cdots + d_nu_n $$  Since there exists a bijection between $U$ and $V$, they are isomorphic.


Is there an STL or boost adaptor which lets me use vector> as vector?

I'm used to have a vector of wstring. I need to store the line number for each string, so I refactored the vector to be vector<pair<wstring, size_t>>. If possible, I'd still like to use this vector like a vector<wstring> in some contexts. This is my code:  typedef std::pair<std::wstring, size_t> LineNoPair; typedef std::vector<LineNoPair>         LineNos; LineNos lines; // Split lines, but don't split at line continuations boost::split_regex(lines,  // <-- I'd like to use `lines` as the split target                    contents,                     boost::wregex(L"(((?<![_])\\r\\n)|((?<![_\\r])\\n))"));  for (LineNoPair& line : lines) {     // remove line continuations from string     boost::replace_all_regex(line.first,                               boost::wregex(L"(_?[ ]*\\r?\\n)"),                               std::wstring()); }   I could simply use a vector of strings and a separate vector of line numbers, but I'd like to be able to iterate over these items together.   So, the general question is: Is there a thing which lets me use a vector of tuples like a vector of one of the tuple's types?  This question is different from  as I need a vector-compatible interface (including swap) whereas the other question is only about iterator adaptors.


I need to run some basic physics simulations on a headless machine and I'd like to program agent movements based on function outputs (e.g. "move left")-I have some code that programs WASD to move a cube that I'd like to modify such that it doesn't actually require me to press any keys but rather, if the program receives "Wkey" as an input (from another function) it's able to move the agent in the desired direction. Is this possible? (I also want to try to avoid using the logic editor to run the script if possible, any help on that would also be appreciated)    Current code below:   import bge   def main():      cont = bge.logic.getCurrentController()     own = cont.owner      keyboard = bge.logic.keyboard      wKey = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.WKEY]     sKey = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.SKEY]     aKey = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.AKEY]     dKey = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.DKEY]      if wKey:          own.applyMovement([0,0.2,0],True)      if sKey:          own.applyMovement([0,-0.2,0],True)      if aKey:          own.applyMovement([-0.2,0,0],True)      if dKey:          own.applyMovement([0.2,0,0],True)  main()


When is it appropriate to use the HTML Coded Character Set?

I would like to know when you should represent a particular character as its coded character in HTML, i.e. when (and WHY) should you use &#36; instead of '$' ?  Here is the list I am looking at:


Is it okay to have a good (not strong) recommendation letter from a well-known scientist?

I approached my internship advisor for an LOR while applying to Masters. She said she would not be able to provide a strong one but a good one based on an internship that lasted for two months. I approached her because she holds a PhD from a good university in the USA and she's published papers in top-tier conferences and journals. Will it adversely affect my application? Will it hold as much weight as a strong one because it's she who's recommending it?


Cross references to "false" sections (see "subsections as an enumerate")

This question on  was exactly what I wanted to ask yesterday, and StevenB.Segletes' answer almost does what I want, but it doesn't seem to quite work. I can't really post code in that question to show what I mean, so I felt I ought to start a new question.  What I want to do is generate pseudo-subsections with user-defined titles (In my case I want to write "Case Study 1" etc, just as in the above question. What I also want to do is to be able to refer to these items in the text. Steven's answer looked like it works, but actually the counter doesn't increment, and in fact picks up the section number. Can anyone advise how to get this working?  \documentclass{article} \newcounter{casestudy} \newcommand\nextCaseStudy[1][]{\stepcounter{casestudy}\subsection*{Case Study \thecasestudy#1}}  \begin{document}  \section{Dummy 1}  \section{Dummy 2}  \section{Case Studies}  \nextCaseStudy[\label{cs1}] Some details \nextCaseStudy[\label{cs2}] Some details  \section{My next section}  I now want to refer to something in \ref{cs2}  \end{document}   This generates the following output:


Semicolon or double ampersand for chaining commands?

When writing a bash script, which is better to chain commands, a semicolon ; or double ampersand &&?


Evaluating $\sum_{i=0}^{k-1} 4^i(i-1)$ for recurrence relation exercise

I need help to solve the following sum: $$\sum_{i=0}^{k-1} 4^i(i-1)$$ I'm doing some exercises about recurrence relations in algorithms and this sum came up.   The exercise stands like:  $$T(n) = \frac {1}{2}n + 4T(\frac{n}{2} + 3)$$  And the result I get was:  $$ T(n) = 4^n T(\frac{n}{2^k}+3k)+[\sum_{i=0}^{k-1}\frac{4^in}{2^{i+1}}+4^i*3*(i-1)]$$  All of this is new to me, all the examples i saw online are way more different than this excercise   Am I getting closer to an answer?   Note: No base case was given   Thanks in advance!


I was in a meeting vs I was at a meeting

What's correct?      a) I was in a meeting      b) I was at a meeting   I saw uses in both of them, but I'm not sure what's correct.


Should I use an infinitive or gerund to explain the how people can earn money? Context: Get paid to teach Spanish/teaching Spanish

Which variant is correct grammatically and is used more often among native speakers?


Remote Desktop: Zoom AND full screen -- how? (Win10 remote, Win7, 2008 & 2003 hosts)

Problem: When I use remote desktop from a Surface Pro 4, running Win 10, to a Win7 or Win2003 system, the high dpi of the Surface results in the remote desktop being too tiny to see. In this case, the remote is the surface (with high resolution display), and the host is low (legacy 92 dpi) resolution display.  This issue is discussed and demonstrated  and   However, the problem I experience is the following:  Yes, there is the Zoom feature in the rdp client. However, when I use it, I lose the ability to go full screen on the client (to use all client real estate, and to get alt-tab and other keys passed up to host). After 30 min of use, I can say clearly that the zoom feature in the win10 RDP client is NOT useful for real work.  We made sure the Win7 hosts are already on Win7-SP1 with kb2923545 installed. This makes no difference that we can see.  I tried using Remote Desktop Connection Manager, , but it appears to lack the ability to give me a zoomed , full screen experience (perhaps I failed to find it, but I poked it a lot! There is a report that the current 2.7 version lacks the needed functionality, and that the older 2.2 version should work, but we did not find the 2.2 version for download).  So.... my old Vaio laptop is great for remote desktop, and my new Win10 Surface is, currently, unusable as a remote desktop remote client.  How do I get my new Surface as usable as the old Vaio?  Note: We are looking to use the Win10 Surface as a real rdp client to Win7, 2008 and Win2003 hosts. Right now, from all our work so far, this is simply a missing feature. (And we are suffering!)  Note: Please don't tell us to "log out and start a new session" on the host: This defeats the purpose, is not useful, and is a huge regression from the functionality we had before trying the Surface. Also, please don't tell us that only win10-win10 gives the right experience. We had a fine experience using legacy-dpi remote systems. The problem is the high-dpi surface.


Non-resident alien: Why did I pay no tax on dividend income?

I have a US stock brokerage account, and I am a non-resident alien. From my understanding, dividend income of non-resident aliens is taxed at a flat 30% rate (assuming no applicable tax treaties). I am currently resident in a jurisdiction with no applicable tax treaties with the US.  In June 2020, I bought 10 shares of VTIP (Vanguard Short-Term Inflation-Protected Securities ETF). In October 2020, I was paid a dividend of $2.80 of which 30% ($0.84) was withheld. In December 2020, I was paid a dividend of $3.33 of which 30% ($1.00) was withheld.  Surprisingly, I got a $0.84 and $1.00 refund in February 2021. I checked the Form 1042-S provided by the stock brokerage firm, and noticed that I was somehow exempted from all tax. Can someone explain what happened? Why was my tax rate 0%? UPDATE: I now understand the situation after reading all these pages:    Bogleheads forum:   Bogleheads wiki:  Relevant section: Interest distributions paid as dividends  Bogleheads wiki:  Relevant section: Special exemption for interest distributions paid as dividends


What is electron hole? Isn't it just an absence of electron?

I was reading Wikipedia article about  and there's something in it's definition that makes me wonder:     Impact ionization is the process in a material by which one energetic charge carrier can lose energy by the creation of other charge carriers. For example, in semiconductors, an electron (or hole) with enough kinetic energy can knock a bound electron out of its bound state (in the valence band) and promote it to a state in the conduction band, creating an electron-hole pair.   Isn't "electron hole" concept to express lack of electron? I thought it is similar concept to "darkness", which is lack of light.   And if it is just a lack of electron, how can "empty space" knock out an electron? If it's "just a hole" (there's nothing there), then it have no mass, no real energy... how can it even affect another electron in such way that it will be pushed away?  I would be glad if someone could explain to me what really electron hole really is, and if it's not just an absence of something, then what is it?


How to upgrade ipad 2 to 7.1.2 not 8.0.2?

I have an iPad 2 wifi, and it is currently on 7.0.4. I would like to update to 7.1.2 not 8.0.2 which is the default update when I go into iTunes. I tried shift clicking and choosing 7.1.2 I have saved but I keep getting an error that says its not eligible for the requested build. I have checked my hosts file, and there seems to be nothing wrong there. What could be causing this error?


I need to have other cities' time on Ubuntu 18.04, like on Ubuntu 16.04 Time & Date settings, but I can find no information on how to do this. Any Suggestions?


monitor won't stay on if I close the lid

I am using Ubuntu 14.04. I can't get the external monitor to stay on if I close my laptop's lid. I have been using Ubuntu since 12.04 and I have always had the same problem. Can anyone help? Thx.


Is there an application that allows me to view Markdown files?

I don't want a WYSIWYG Markdown editor. I wouldn't mind if the app allows me to edit the file, as long as it renders it separately.  I know that Markdown is easy to read without rendering it but I often want to check to make sure my document looks right before uploading it to GitHub, so it would be nice to have an app to view Markdown documents.


Why are MA(q) time series models called "moving averages"?

When I read "moving average" in relation to a time series, I think something like $\frac{(x_{t-1} + x_{t-2} + x_{t-3})}3$, or perhaps a weighted average like $0.5x_{t-1} + 0.3x_{t-2} + 0.2x_{t-3}$. (I realize these are actually AR(3) models, but these are what my brain jumps to.) Why are MA(q) models formulas of error terms, or "innovations"?  What does $\{\epsilon\}$ have to do with a moving average? I feel like I'm missing some obvious intuition.


highlight text between selector without highlighting nor deleting the selectors

So I'm trying to render something beautiful for my PHP code using the \lstdefinestyle command.  I think the basic configuration is good, but I would like to highlight the function name to render it in the color normal.  Here is my code:  \documentclass[10pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{listings}             % to insert code \usepackage{xcolor} \definecolor{background}{RGB}{40, 44, 52}           % gris foncé \definecolor{comment}{RGB}{92, 99, 112}             % gris clair \definecolor{keyworld}{RGB}{86, 182, 194}           % cyan \definecolor{string}{RGB}{152, 195, 121}            % vert \definecolor{identifier}{RGB}{198, 120, 221}        % mauve \definecolor{classic}{RGB}{224, 108, 117}           % genre de rouge \definecolor{normal}{RGB}{171, 178, 191}            % blanc \definecolor{specialkeyworld}{RGB}{229, 192, 123}   % jaune orange \definecolor{veridad}{RGB}{209, 154, 102}           % orange jaune  \lstdefinestyle{myPHP}{   language=PHP,                 backgroundcolor=\color{background},      basicstyle=\footnotesize\ttfamily\color{normal} ,        keywordstyle=\color{keyworld},        commentstyle=\color{comment},        numberstyle=\color{background},    identifierstyle=\color{classic},   stringstyle=\color{string},       emph        =[1]{function,try,return,catch, new},   emphstyle   =[1]\color{identifier},   emph        =[2]{Exception, PDO},   emphstyle   =[2]\color{specialkeyworld},   emph        =[3]{true, false},   emphstyle   =[3]\color{veridad},   emph        =[4]{connectAccess},   emphstyle   =[4]\color{normal},   stringstyle=\color{string},        breakatwhitespace=false,                 breaklines=false,                            keepspaces=true,                   numbers=left,                      numbersep=4pt,                    showspaces=false,           showstringspaces=false,       } \begin{document}     \begin{lstlisting}[style=myPHP]     /**      *  Connect an Access database      *  @param  string  $path   Name of the database you want to connect to      *  @return PDO object initialise      */     function connectAccess($path){       try {         $db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; Dbq=$path;");         return $db;       } catch (Exception $e) {         echo 'Connection failed: ' . $e->getMessage();         return false;       }     }     \end{lstlisting} \end{document}   and the result :     I would like to replace the two lines    emph        =[4]{connectAccess},   emphstyle   =[4]\color{normal},   with something that will highlight what is between function and ( without selecting those two, because I will be displaying a lot of code in my document and I dont want to escape the function name each time.  I've tried moredelim=[is][\color{normal}\ttfamily]{function}{(}, but it render like this :     with moredelim=[s][\color{normal}\ttfamily]{function}{(}, the 'function' selector is also rendered in the \color{normal} font...  and I have pretty much the same results with morecomment.  What am I doing wrong? aren't moredelim and morecomment the right parameters to use? if not, what are the original purpose of these two?  Is there a(nother) way to do it or will I have to escape the function name each time?  Thank you for your time and answer, Guillaume


I want to create a table with arrows between some cells, for which I've used  and TkiZ. I have the following problems:  Text in cells aligned vertically to the center and at the same heigh (TikZ nodes are not inline with normal cells text in a same row). Inability to align to the center with \begin{center}•\end{center}. I don't know how to fix the size of the cells.  This is what I currently have: Code \documentclass{article} \usepackage{tabularx} \usepackage{tikz} \tikzset{every picture/.style={remember picture}} \begin{document} \begin{tabularx}{\textwidth}{r|c|c|c|c|l}     &$D_1$&$D_2$&$D_3$&$D_4$&foo\\ \cline{1-6}     $O_1$&\tikz[baseline]{\node (a11) {50};}&\tikz[baseline]{\node (a12) {0};}&&&50\\[2em] \cline{1-6}     $O_2$&&\tikz[baseline]{\node (a22) {60};}&&&60\\[2em] \cline{1-6}     $O_3$&&\tikz[baseline]{\node (a32) {10};}&\tikz[baseline]{\node (a33) {30};}&\tikz[baseline]{\node (a34) {10};}&50\\[2em] \cline{1-6}     $O_4$&&&&\tikz[baseline]{\node (a44) {50};}&50\\[2em] \cline{1-6}     bar&50&70&30&60&210\\ \end{tabularx} \begin{tikzpicture}[overlay]     \path[thick,->] (a11) edge (a12);     \path[thick,->] (a12) edge (a22);     \path[thick,->] (a22) edge (a32);     \path[thick,->] (a32) edge (a33);     \path[thick,->] (a33) edge (a34);     \path[thick,->] (a34) edge (a44); \end{tikzpicture} \end{document}   Besides, I get the following warnings:  Underfull \hbox (badness 10000) in alignment at lines 13--13 Overfull \hbox (15.0pt too wide) in paragraph at lines 13--22


I have been using my own self-made "iptables rules" for blocking all the major type of DDOS attacks on game-servers because these attacks were application/game-server specific instead of the general DDOS attacks. It took me almost 3 years to study those attacks and respond with these rules. Up til now, I was using a rate-limit on iptables that would automatically DROP the IP if it made 250 hitcounts/sec as the client rate is much lower than this (maximum it goes is like 500kb/s). This is because attackers would generally send a large number of hit-counts with packets of the length 15:30 as this is the general packet-length where the game-server responds well. This worked really well until someone attacked with something different today to get through this rule.  -A INPUT -p udp -m udp --dport 16000:29000 -m recent --set  -A INPUT -p udp -m udp --dport 16000:29000 -m recent --update --seconds 1 --hitcount 250 -j DROP    Recently, I observed attacks that were easily making 1-3mb/sec of input, as seen through "iftop" to my servers and the above rules weren't blocking them because my game-server was responding with "....disconnect" packets to all the incoming connections. This happens when game-server doesn't recognize the input string or length of the packet. This was the content of the packet:    Now as you might as well see that the packet had a huge length. According to Wireshark where I grabbed the packet, the length of the packet was 700 and data size/length was about 5000 bytes. And I've seen this before that if you have a higher data-length/size of the packet, you can still have a higher rate even with a fewer hitcounts. So this explains maybe why it had an input of around 3mb/s and it didn't get blocked through the hitcounts, because it never had hitcounts greater than 250..  Now I need something that would more be bandwidth specific than the number of packets/second. I require an iptables rule that would automatically block an input>1mb/s and it may use the length of the packet if needed. The general data-size/length of a fair game-server client would usually have packet lengths and data-size of less than 500 bytes but it might go higher in some cases but will never take more than 500kb/s of bandwidth.  The question is different than the rest of previously answered questions because it's firstly application specific. Secondly, I am asking an iptables solution that would deny any input >1mb/s?  Update:  I did some theoretical working to explain why a 3 Mb/s input bandwidth is not more than 250 hitcounts/second and here  is the working:  3 Mb = 3x1024x1024 = 3,145,728 bits/sec = 393,216 Bytes/sec  Hence,  If a packet had the size of 5000 bytes so the maximum number of packets per second should be:  393216/5000 = 78.6 Packets/second  And this means that if the iptables rules had to work, the packet should have been smaller than 393216/250 = 1516 bytes.


Does wave interference happen only to same frequency waves?

As the title says, from books and results from internet, I find that examples of wave interference always have the same frequency, only different in phase constant.  So, I'd like to know if wave interference happens only to same frequency waves


Why modifying a string with different ways have different behaviors?

Why these two code snippets have different behaviors  char p[] = "hello"; p[0] = 'W'; //works fine   While this gives a segmentation fault  char *ptr = "hello";  ptr[0] = 'W'; // undefined behavior   What is the difference between both codes,why i am unable to modify the string using pointer?


Inspired by   According to the answer, The Lord of the Rings has both half-elves and half-orcs, but no half-dwarves or half-hobbits.  Is there any example in LOTR of half-dwarves? If not, is there any clear reason? For example, is it because some sort of genetic incompatibility, or is it more because no proper dwarf would ever be caught copulating with a stinking tree-hugging elf?


I have looked around on cross validated as well as other places but can't seem to find an answer. I'm running a generalized linear mixed-effects model.   Y~initial abundance + Treatment + (1|Month)  Where Y is count data (abundance of prey)  Initial abundance is a covariate of initial abundances before any treatments Treatment is a factor of two levels (control and treated) Month is a random intercept due to repeat sampling  The context of this model is an experiment where I reduced a predator in "treated plots" and left the other plots as "controls". Prior to the start of this experiment baseline sampling was done in all plots. I realized some plots natural had higher abundances of prey than other plots. So I decided to use these initial abundances as a covariate to control for the natural unequal abundances between plots. Here is the question: Should this covariate be included as a random effect versus a covariate that's a fixed effect? My understanding is that it could be technically be used as either.  I used it as a covariate because I know that if more prey are abundant than the effects of reducing a predator would most likely be higher than in a poorly abundant plot. It was something that I knew would have an effect on my response of prey abundance. However, I don't know if this reasoning is justified. Any info or opinions would be welcomed!  Thanks


What are the best seat places to choose inside an international flight for economy class?

Considering that I can choose any seat on any seat row on a Boeing 777-300ER for an international flight, I have most of 400 seat places to choose from the forefront to the last row of . What are the best options if I bought an economy class ticket, traveling in a group of 4 people and if I want two windows? Are there any advantages in choosing the last places instead of the front ones?


Mean absolute error OR root mean squared error?

Why use Root Mean Squared Error (RMSE) instead of Mean Absolute Error (MAE)??    Hi  I've been investigating the error generated in a calculation - I initially calculated the error as a Root Mean Normalised Squared Error.  Looking a little closer, I see the effects of squaring the error gives more weight to larger errors than smaller ones, skewing the error estimate towards the odd outlier. This is quite obvious in retrospect.   So my question - in what instance would the Root Mean Squared Error be a more appropriate measure of error than the Mean Absolute Error? The latter seems more appropriate to me or am I missing something?  To illustrate this I have attached an example below:                    The scatter plot shows two variables with a good correlation,  the two histograms to the right chart the error between Y(observed ) and Y(predicted) using normalised RMSE (top) and MAE (bottom).     There are no significant outliers in this data and MAE gives a lower error than RMSE. Is there any rational, other than MAE being preferable, for using one measure of error over the other?


how i cover ApexPages.currentPage().getParameters().get('ScheduleFlag') == 'True' in test class

if(ApexPages.currentPage().getParameters().get('ScheduleFlag') == 'True'){             schId = ApexPages.currentPage().getParameters().get('schId');             schReport = [Select Id,Report_Name__c,Selected_Fields__c,Labels__c  from Schedule_Report__c where Id = :schId];             allFields = schReport.Selected_Fields__c;             allLabels = New List<string>();             for(string lab :schReport.Labels__c.split(',')){               allLabels.add(lab.trim());               }             ScheduleFlag = true;             directSchedule = true;             WeeklyFlag = true;             userList = new list<SelectOption>();             for(user usr : [SELECT Id,IsActive,Name,Email FROM User where IsActive = true]){                 userList.add(new SelectOption(usr.Email,usr.Name));             }              //Next4();         }     }


How did the Four Horsemen rob the French bank?

In the movie Now You See Me, the Four Horsemen rob a French bank and later reveal that the robbery was all an illusion. When Thaddeus Bradley (Morgan Freeman) was explaining it I still couldn't understand how they did this trick.  This is really driving me crazy, would someone please explain it to me so I don't go insane?


Is the Ministry of Magic unable to detect illegal time-tampering?

Since Hermione already admitted that they were breaking the Law. Would it be safe to conclude that the Ministry cannot instantly (by magic) detect illegal time-tampering?  (Both before and during the events of Prisoner of Azkaban.)     “Hermione,” said Harry suddenly, “what if we — we just run in    there and grab Pettigrew —”       “No!” said Hermione in a terrified whisper. “Don’t you understand?    We’re breaking one of the most important wizarding laws!    Nobody’s supposed to change time, nobody! You heard Dumbledore,    if we’re seen —”       — Prisoner of Azkaban, chapter 21 (Hermione’s Secret)


I have an entity that cannot exist without being defined by another, and I want this entity to participate in a many-to-many relationship.  Example: An artist has an album (the album cannot exist without an artist), the album also has many tracks, but the same track can exist in many albums.  So we have a many-to-many relationship between the album and the tracks.  If the album is a weak entity, then its primary key is a foreign key referencing the artist, thus it cannot be a foreign key to another table representing a many-to-many relationship.  The question is: is it possible to have this kind of relationship in SQL, and if so, how do I express it?


The grammatical usage of verb to be in 'Whether we be old'

I was reading Harry Potter when I stumbled across this phrase in a song.  Whether we be old and bald  And this is the part of the song containing the phrase for a better understanding of the context.  Teach us something please   Whether we be old and bald   Or young with scabby knees  I don't understand why verb to be is put in an infinitive form. It sounds good to my ear but shouldn't it be phrased like this: Whether we are old and bald What's the grammar behind phrasing it the way it is, does it give any difference in meaning than the usual present form?


What are snap loop devices and can I safely remove them?

In Ubuntu 17.10 I noticed 2 new partitions when using gnome-disk-utility. From what I understand, they are snap partitions/loop devices created when installing pieces of software. Note that I don't see them listed as partitions in gparted which I find confusing. The problem is I don't know why I have them and would like to get rid of them.  Do I need them? Is it safe to just delete them? For instance, what would happen if I were to delete bluez_129.snap, would I lose my Bluetooth tools?


Travel from France to Saint Louis, do I need to pick up my luggage when transiting in the US?

I need to travel from Paris CDG (first flight Air France, 2nd flight Delta, both cies are sky team) to Saint louis missouri via Minneapolis. During the connectiong flight from international to Domestic), Do I need to pick-up my luggage in minneapolis and immediately check-in for domestic flight, or will my luggage will go direclty to Saint-louis. If yes, is it convenient in Minneapolis (I have only 1H25 minutes stop?


What is the most general conception/formalization of "energy"?

(disclaimer: I am not a physicist).  I have been taught about the concept of energy in a fairly ad-hoc way. i.e. I was simply "told" that kinetic energy equals $\frac 1 2 m v^2$, and similarly I was told what potential energy is. Then I was shown how energy is conserved over time (in a classical system).  The concept of energy sort of intuitively makes sense to me, but I'd like a better understanding than just this ad-hoc one. At one point I thought of energy as "a basic quantity that is preserved over time in physical systems as the result of the underlying equations of motion". This seems true, but there are other quantities that are preserved, such as momentum, or the function $f(s)=5.6$ which maps every element of state space to $5.6$. Hence it doesn't really help me understand the concept.  Moreover, the concept of energy emerges in wildly different areas of physics (e.g. in classical, quantum, and general relativistic physics), where the concept seems to have the same general meaning despite the differences. I can even imagine that the concept of energy could apply to dynamical systems that have absolutely nothing to do with the physical world, such as certain completely artificial simulations, so long as they satisfy certain properties.  What is the most general conception/definition of energy? i.e. one that makes the least amount of assumptions about the underlying system (perhaps even so that the underlying system is not a "physical" system but an element from some more general set of dynamical systems).   I know that energy is conserved, but this doesn't distinguish it from other conserved quantities. Noether's theorems imply that there is a quantity that is conserved due to time translation invariance. Is it conceptually insightful to see this as the "definition" of energy? If not, what is the most general definition of energy? And why does time translation invariance induce a conserved quantity that has such an important role in physics?


Find the derivative of $y = x^{1/2}$ by using differentiation from first principle.

For this question, I tried to apply the derivative limit formula on it but I have a problem with the square root there: $$\lim_{\Delta x \rightarrow 0}\frac{\sqrt{x+\Delta x}-\sqrt x}{\Delta x}$$ If I divide each term by $\Delta x$, as $\Delta x \to 0$，I get $1$ but this is not the correct answer.  I have also tried to expand $(x + \Delta x)^{1/2}$ by using binomial expansion but I forgot the ways to  apply it on the power of $1/2$.  Anyone know how to solve it by using differentiation from first principle?


My chain on 9 speed is slipping. I measured my chain but the slipping continues.


Malformed lines in sources.list - how can I correct them?

I am facing a problem with /etc/apt/sources.list  The 52nd line appears to be malformed  Line 52: deb http://archive.canonical.com/ precisepartner  Line 53: deb-src http://archive.canonical.com/ precisepartner  This problem has caused Synaptic Package Manager and Ubuntu Software Center to not function properly and close abruptly.


Bluetooth stopped working suddenly on 16.04

My bluetooth has been working without any issue for several months and today it just stopped working.   sudo systemctl status bluetooth ● bluetooth.service - Bluetooth service    Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)    Active: active (running) since pon 2019-12-23 20:07:18 CET; 2min 43s ago      Docs: man:bluetoothd(8)  Main PID: 1488 (bluetoothd)    Status: "Running"     Tasks: 1    Memory: 2.7M       CPU: 7ms    CGroup: /system.slice/bluetooth.service            └─1488 /usr/lib/bluetooth/bluetoothd  gru 23 20:07:18 Home bluetoothd[1488]: Error adding Link Loss service gru 23 20:07:18 Home bluetoothd[1488]: Not enough free handles to register service gru 23 20:07:18 Home bluetoothd[1488]: Not enough free handles to register service gru 23 20:07:18 Home bluetoothd[1488]: Not enough free handles to register service gru 23 20:07:18 Home bluetoothd[1488]: Current Time Service could not be registered gru 23 20:07:18 Home bluetoothd[1488]: gatt-time-server: Input/output error (5) gru 23 20:07:18 Home bluetoothd[1488]: Not enough free handles to register service gru 23 20:07:18 Home bluetoothd[1488]: Not enough free handles to register service gru 23 20:07:18 Home bluetoothd[1488]: Sap driver initialization failed. gru 23 20:07:18 Home bluetoothd[1488]: sap-server: Operation not permitted (1)   dmesg  dmesg | grep bluetooth [    5.440959] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0b05-17cb.hcd failed with error -2   Why has it stopped workign and how do I fix this? What's going on? I cannot pair any device.  I have already tried reinstalling bluetooth and bluez and pulseaudio but it didn;t solve it. Additionally, when I now click on the system settings cog icon to access system settings, nothing happens.


The Android App does not show deleted answers

The Android App does not show any deleted answers at all, even on sites where I am a moderator. I just got a notification about a new meta post, the post is about a deleted answer, but when I follow the link to the answer the app pretends that there are no answers at all on that question.


Correlation Coefficient of two Order Statistics

My problem is exactly the same as asked in  with a change in the notation of the two order statistics. Reframing the question:  If $\left(X_1,X_2,…,X_n\right)$ are a random sample from Uniform(0,1) distribution, find the correlation between the order statistics $X_{i:n}$ and $X_{j:n}$, $i<j$.  My approach was exactly similar to what the author of the linked question did:  I have used the formula for correlation coefficient as: $$\rho=\frac{E[X_{(i)}X_{(j)}]-E[X_{(i)}]E[X_{(j)}]}{\sqrt{Var(X_{(i)}) Var(X_{(j)})}}$$  And I arrived at the exact same dead-end: I'm unable to compute $E\left[X_{(i)}X_{(j)}\right]$. What I have tried till now: The joint pdf of $X_{i:n}$ and $X_{j:n}$ is given by $$f_{i,j:n}\left(x,y\right)=\frac{n!}{(i-1)!(j-i-1)!(n-j)!}x^{i-1}(y-x)^{j-i-1}(1-y)^{n-j}$$ where $0<x<y<1$. Let $Z=X_{i:n}X_{j:n}$ and $W=X_{j:n}$. Thus, the joint pdf of $Z,W$ is given by $$\begin{align}f_{Z,W}\left(z,w\right)&=f_{i,j:n}\left(\frac{z}{w},w\right)\left|w^{-1}\right|\\ &=\frac{n!}{(i-1)!(j-i-1)!(n-j)!}\left(\frac{z}{w}\right)^{i-1}\left(w-\frac{z}{w}\right)^{j-i-1}\left(1-w\right)^{n-j}\frac{1}{w} \end{align}$$ Finally, we can get the pdf of $Z=XY$ as $$\begin{align}f_Z(z)&=\frac{n!}{(i-1)!(j-i-1)!(n-j)!}\int_0^1\left(\frac{z}{w}\right)^{i-1}\left(w-\frac{z}{w}\right)^{j-i-1}\left(1-w\right)^{n-j}\frac{1}{w}\cdot dw\\ &=z^{i-1}\frac{n!}{(i-1)!(j-i-1)!(n-j)!}\int_0^1\left(\frac{1}{w}\right)^{i-2}\left(w-\frac{z}{w}\right)^{j-i-1}\left(1-w\right)^{n-j}\cdot dw\end{align} $$ But I cannot proceed further from here. I cannot use a computer to do this.  provided a wonderful solution to the linked question and  question also. But those were done using the software. Any help/suggestion to how I can proceed from here would be very much appreciated.


Is this a non empty perfect set with no rational numbers?

Let $A$ be the Cantor set and   $B = \pi\, (-A \cup A)$.  Is B a perfect set with no rational numbers?


In the current era of cricket, we see batsmen using switch hits to play a ball. That is, while playing a ball they change their batting side (left to right handed and vice versa) just before the ball comes to them.  My question is, can a bowler bowl a switch ball? Meaning, can a left hand bowler bowl right handed to a batsman? If it is not permitted, then is it not unfair to the bowlers that batsmen can change their batting style but not the bowlers? Or are there are any rules against a switch hit?


Dynamically created datepicker not working from created second row

Dynamically created date picker not working from created second row:  $(document).ready(function () {     $(".add_button").click(function () {         var currentRow = $(this).parents("tr");         var nr = currentRow.clone(true, true);         nr.find(".name").val('');         currentRow.after(nr);     });     $(".del_button").click(function () {         var currentRow = $(this).parents("tr");         if ($(".test tr").length != 2)         {             $(this).closest('tr').remove();         }         else         {             alert("You cannot delete first row");         }     }); });   <script>     $(function () {         $("#datepicker").datepicker({autoclose: true});     }); </script>


How to effectively address conflicting suggestions from reviewers

A bit of background, I am doing research in atmospheric physics and detection systems  Recently, I received a paper submission back with revisions suggested by a couple of reviewers.  For the most part, the revisions were definitely constructive, justified and most importantly, helpful.    That is, except on one particular crucial aspect of the paper where both reviewers made suggestions, that they labelled as critical for the paper's success.  However, the suggestions were directly opposite.  i.e. Both suggestions are mutually exclusive, but equally feasible.    What is an effective means to address this conflict?  I have spoken to my academic supervisor and he is not sure how to proceed either and we have double checked and both suggested paths are feasible.


Show if a user is online, idle, or offline on their account page?

I want to display the status of the user on the account page. I added the following code in the theme I am using. It works, but users are never displayed offline. Why? What is wrong in the code? user.html.twig
   {% if status == 'Online' %}      Online   {% elseif status == 'Absent' %}      Absent   {% else %}      Offline   {% endif %}
  bootstrap_subtheme_front_office.theme <?php /**  * @file  * Bootstrap sub-theme.  *  * Place your custom PHP code in this file.  */  use Drupal\Core\Database\Database;  /**  * Implements hook_entity_presave().  */ function bootstrap_subtheme_front_office_preprocess_user(&$variables) {   // get user object   $user = $variables['elements']['#user'];   //- The user has logged in at least once   if ($user->getLastLoginTime()) {     if (account_is_logged_in_less_then_thirty_minutes($user->id())) {       $status = 'Online';     }     else {       $status = 'Absent';     }   }   else {     $status = 'Offline';   }   $variables['status'] = $status; }  /**  * @param $uid  *  * @return bool  */ function account_is_logged_in_less_then_thirty_minutes($uid) {   $connection = Database::getConnection();   $query = $connection->select('sessions', 'sessions')     ->fields('sessions', ['sid', 'uid', 'timestamp'])     ->condition('sessions.uid', $uid, '=')     //- chef if the user was online in 30 minutes (60 * 30)     ->condition('sessions.timestamp', \Drupal::time()         ->getRequestTime() - (60 * 30), '>')     ->execute();   //- Get result.   $results = $query->fetchAll(\PDO::FETCH_OBJ);   return (count($results) > 0) ? TRUE : FALSE; }


How to get the worldspace location of a rendered pixel from Python

I need a way to find the underlying 3D coordinates for each pixel of the camera in Python.  I to create a function like:  GetCoordinatesForPixel(xPixel, yPixel)  which returns a (X, Y, Z) vector.   I found the following threads:   which is supposed to be a duplicate of this one:   The latter solution works in that it procudes a render. However, I do not see a way to access those values in Python.


binary search tree in java throws Nullpointer exception

Hi I've implemented a Binary search tree in java. It enters data fine. But it throws a Nullpointer exception when attempt to search. Please point where I am wrong. thanks in Advance...  class Node{ int data; Node leftChild; Node rightChild;   }  Follwing is my main method and both search and insert methods..  public class Main { Node root;  public static void main(String[] args) {     Main main=new Main();     main.insert(15);     main.insert(12);     main.insert(9);     main.search(12);  }  void insert(int data){     Node node=new Node();     node.data=data;      if(root==null){         root=node;         System.out.println("Root node created: "+root.data);      }else{         Node current=root;         Node parent=null;         while(true){             parent=current;               if(parent.data>data){                 current=parent.leftChild;                 if(current==null){                     current=node;                     System.out.println("Created node: "+current.data);                     break;                 }              }else{                 current=parent.rightChild;                 if(current==null){                     current=node;                     System.out.println("Created node: "+current.data);                     break;                 }             }             if(current==null){                 break;             }          }       }  }  Node search(int data){     Node current=root;     if(root==null){         System.out.println("Empty binary tree");     }else{         while(current.data!=data){             if(current.data>data){                 current=current.leftChild;             }else{                 current=current.rightChild;             }             if(current==null){                 break;             }         }         System.out.print("Data  item Found :"+current.data);     }     return current;  }   }


"With what [...]?" or "What [...] with?"

Making a comparison with Who/Whom I now have a question about the use of what with prepositions in questions. I'll explain by example:  These two sentences are correct, one is more formal than the other:  Who/Whom     Formal: With whom are you doing that? Informal: Who are you doing that with?   But if I substitute Who/Whom with What, the "formal" one sounds a bit awkward and I'm not sure if it's correct or not:  What     With what are you doing that? What are you doing that with?   So, are those last two questions grammatically correct? Is one more formal than the other?


Undefined symbols when using curl in C++

I want to get a file via http using curl. My environment is GCC (Mac OS X). I've created a simple class Shared to use it smth like this:  #include "Shared.h" ... std::string str = Shared::getHTTPFile( "http://google.com" );   When I try to compile it with the following command:  g++ -o test -l curl test.cpp   I get an error message:  Undefined symbols for architecture x86_64: "Shared::curlBuffer", referenced from:  Shared::getHTTPFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test-a10048.o  Shared::writer(char*, unsigned long, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in test-a10048.o "Shared::errorBuffer", referenced from:  Shared::getHTTPFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test-a10048.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)   My code of Shared class is just simple:  #include <string> #include <stdio.h> #include <curl/curl.h>  class Shared {  public:     static char errorBuffer[ CURL_ERROR_SIZE ];     static std::string curlBuffer;     static int writer( char *data, size_t size, size_t nmemb, std::string *buffer ) {         curlBuffer.append( data, size * nmemb );         int result = size * nmemb;         return result;     }      static std::string getHTTPFile( std::string url ) {         CURL *curl = curl_easy_init();         CURLcode result;         if (curl) {             curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer);             curl_easy_setopt(curl, CURLOPT_URL, "http://google.com" );             curl_easy_setopt(curl, CURLOPT_HEADER, 1);             curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer );             curl_easy_setopt(curl, CURLOPT_WRITEDATA, &curlBuffer );             result = curl_easy_perform( curl );         }         curl_easy_cleanup(curl);         return 0;     } };   What do I do wrong here?


Why Don't we Use General Exception Class (Exception) for Catching All Types Of Exceptions

Why do we use the more specific exceptions like IndexOutOfRangeException and DivideByZero exceptions when we can catch them in a catch block like this:  try {     //Some Work } catch(Exception E){}


Firefox won't open Stack Exchange sites due to "TLS FEATURE MISSING"

I'm running Firefox Quantun, 67.0 (64 bit) on macOS Mojave and it won't load any of the Stack Exchange sites and instead shows a "Secure Connection Failed" page with error code: MOZILLA_PKIX_ERROR_REQUIRED_TLS_FEATURE_MISSING  Chrome works fine.    I believe this might be an issue with StachExchange OCSP response Stapling:


I want to translate Ubuntu in fon (my language). The Fon is most spoken language of Benin.  Could someone let me know how I can do it ?  Thanks.


Why main() does not need a return type(say int), even when it return an intiger?

#include<stdio.h> main() {  //  // return 0; }   I meant, the above code does not shows any error even though I didn't specify the return type of it. (simply 'main' instead of 'int main').


How to use the same PCA on test as on training in Weka?

I have implemented PCA on training data and the result is ready. Now I want to use the same PCA on test. Is there any way to perform the same PCA on test as training in weka?


Comparing dates in javascript doesn't always work

I am trying to compare two dates to see if one date is less than the other date, so I format both dates, then check if the expiry date is less than today and if it then show an alert message:  var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1;   var yyyy = today.getFullYear(); if(dd<10){           dd='0'+dd }  if(mm<10){     mm='0'+mm }  var today = dd+'/'+mm+'/'+yyyy;  var ExpiryDate = result.VATExpiryDate; var day = ExpiryDate.getDate();  var month = ExpiryDate.getMonth()+1; var year = ExpiryDate.getFullYear(); if(day<10){       day='0'+day }  if(month<10){       month='0'+month }  var ExpiryDate = day+'/'+month+'/'+year;      if(ExpiryDate < today && result.VATAuthNo.length>0)     {           alert("Please note Vat Authorisation Date for " + result.Name + " has expired - " + ExpiryDate);     }   But it seems it doesn't work for all dates. For example if the expiry date is 10/12/2015 it works and the alert message shows. But if the date is 21/06/2016 it doesn't work, even though that date is less than today.


How to set figure inline with section in ACM sig-Alternative template?

I have a question of the appearance of an image within my paper.  What I want is the following thing:  \subsection{data} text text text, figure comes below \begin{figure} \centering \epsfig{file=data.eps, height=2.3in, width=3.5in} \caption{A sample black and white graphic (.eps format) that needs to span two columns of text.} \end{figure}  \section{next section} above is the figure visible and is positioned within the subsection.   Is that possible? Because now the image is positioned on top of the page itself and not inline with the section.


I have UK VISA for 10 years mentioned “only valid if accompanied by father or mother.” Now I am 21 year old can I enter UK without parent now..?

I have UK VISA Valid for 10 years with a condition  “only valid if accompanied by father or mother.” Now I have attained 21 year of age can I enter UK without parent now..?


If I receive a hacked Pokemon over Wondertrade will it corrupt the game?

I got a shiny Rayquaza over Wondertrade. I noticed it didn't have the blue pentagon next to it. I've been told that's the sign of a hacked pokemon. Will it hurt my game in anyway because I have it?


Comparison problem in ruby: 86.26 != 86.26

How could the following be?  require "bigdecimal/util"  86.26.to_d == 86.26 # => false 86.25.to_d == 86.25 # => true


I want the code to be if entered "shoot" then it'll print "Nice, you killed the zombie" and if the user inputs "don't shoot" then it'll print "oh no, the zombie killed you" this is what I've done so far but it won't print out anything.     public static void main(String[] args) {         System.out.println("ZOMBIE AHEAD!");         Scanner kb = new Scanner(System.in);         String action1 = "shoot";         String action2 = "don't shoot";         String str = kb.nextLine();         if (str == action1) {             System.out.println("Nice, you killed the zombie!");         } else if (str == action2)  {             System.out.println("Oh no, the zombie killed you!");         }     } }


I have as a definition of the closure of a set $E$ in a metric space $(S,d)$ that $E^-$ is the intersection of all closed sets containing E (Elementary analysis the theory of calculus by Kenneth Ross). I have as a hunch that the closure of $E = \{\frac{1}{n}: n \in \Bbb N\} $ is $[0,1]$ since this set seems to contain every element in $E$. How can I prove this to be true?


biblatex - quote in chronological order but bibliography list must be alphabetical order

I want to use more than one type of specification in my bibliography. I want to quote in chronological order but have the bibliography list in alphabetical order.  If I am quoting 2-3 references in the middle of my thesis writing, I want them to be displayed in chronological order.  e.g.          {biblatex}     The human race has had a fast and accelerating growth in terms of technology and communication, in the past decade, [Turner, 2001; Allis   et al., 2007].   {bibliography}    But When the bibliography is displayed at the end of the document, I want them to be displayed in alphabetical order  e.g.    BIBLIOGRAPHY        Allis, C. D., Jenuwein, T., Reinberg, D., and Caparros, M. L. (2007). Epigenetics. Cold Spring Harbor Press   Turner, B. M. (2001). Chromatin and Gene Regulation – Mechanisms in Epigenetics. 2nd Edition, BlackWell Science Ltd.        How should this be achieved given than I use bib latex package? I have not pasted the code of my biblatex line, but I hope that some1 can help me sort this out as not many topics in this forum is handling it.


How frequent do you have to use powered rails uphill?

How frequent do I have to place powered rails to keep climbing at full speed?   Some people say that you only have to use the same amount from powered and non powered, but you can do like 3 powered and 3 unpowered. This is not true, I tried that out. The best way seems to be switching between powered and non-powered (one powered, one non-powered, one powered, ...), which brings a big waste of redstone torches with it. Any other ideas? I didn't test it enough to prove it.  This is NOT the same question as . I ask specifically for full speed and not "minimum of powered rails/maintain reasonable speed".


Suppose one bacterium is in a jar at 12AM, and then suppose there are two bacteria at 12:30AM,  and then there are four bacteria at 1AM, etc.  (a)  How many bacteria will be in the jar at 12PM that day?  (b)  Use trial and error to estimate at what time there will be 1 billion (1,000,000,000) bacteria in the jar.  for a) is it going to be 44 bacterias ? or am i wrong? Please help with b), i have no idea how to figure it out in short term Thanks


Why is the noun for subscribe spelled subscription? ('b' vs 'p')

Why is the verb when paying for a service subscribe, but the noun form is subscription?  Is there a rule that changes "b" to "p"?


why "I think therefore I am" not "I think therefore I am thinking"?

why "thinking" jumped into the conclusion of "existence" as things can exist without thinking too. and what are all the other method except this that could prove our existence?


The magnitude of $|-\sin t + \cos t|$ is.

I am a little bit confused what $$|-\sin t + \cos t|$$ is.   I heard that is $1$ but I thought $\sin t + \cos t$ was $1$.   Is it just that the progression of $t$ is reversed and the size stays the same?   What if the absolute sign is removed? Does it still stay $1$?  ----edit---- Well, they are vectors and the question is asking about the length of the vector. So the length is 1 no matter what the signs are.


If you go to the Hateno village lab early. You will find out about the upgrades to your Sheikah slate's functions.  You can upgrade your scanner to scan for other things than Shrines by proximity.  I used the feature to scan for some nearly worthless weapon (rusty broadsword). I scanned for other things earlier but I used this one to not make it ping everywhere like it would have with Hylian Mushroom.  I don't see a way to "clear" the targeted item from scanner+ so it can scan only for shrines.  Is there a way to clear your scanner+ targeted item?  To be clear I am NOT asking to turn off the indicator only change it back to search only for shrine and nothing else. Which is not a duplicate of the other question.


Prove that $a_n$ is bounded above and that it converges

Let ${a_n}$ be the sequence where $a_1 =\sqrt{2}$, and $a _{n+1} = \sqrt{2+ \sqrt{a_n}}$ for all n ∈ N. Prove that ${a_n}$ is bounded above by 2, and then prove that ${a_n}$ converges.  My thought is to generally employ the monotonic convergence theorem:  Proof.  Because $a_1= \sqrt{2}$, and the sequence is increasing, we see that it is bound below by $\sqrt{2}$. And, if we take the limit as n approaches infinity, we see the limit equals 2, so it is bounded above by 2.  Further by the monotonic convergence theorem, as we see that the sequence is monotonically increasing and bounded above and below, it follows through the M.C.T. that it converges. QED  My question really has to do with showing that it is monotonically increasing, which I believe I need to use induction for, however, I am not sure how exactly to do that, as my book glosses over the subject in a generic review of the concept, i.e. noting the notion that you do $s(n)$ and then show that $s(n+1)$ is also true for all n, but I'm fuzzy on the subject. Moreover, am I correct with my bound assumptions?


We have to find the integration of the following function  I tried but got stuck can anybody help me how to proceed . Is there anyother method to solve this


Why is the fact that a quotient group is a group relevant?

I'm studying the basics of quotient groups. I understand that if you build a quotient set from cosets of a group and the subgroup you are using to build them is normal then you end up with a group.  I fail to see why the fact that we can define operations in the quotient set and make it into a group is meaningful.  What is the motivation to do it? Either historical perspective, practical perspective or any other to understand why we care about this is welcome.


Microsoft Outlook for Mac (version 16.21) is frequently unable to find email messages using the search feature, even in the case of emails that were sent relatively recently. I presume that the search index is broken.   available , and I have even installed a Mac-specific tool called "", but this doesn't ameliorate the problem.  Are any other solutions available?  Edit: There is little else to say (to increase the detail of this question), save that the emails that aren't found are seemingly at random, and are not found on subsequent searches either. I have not limited my search results in any way.


Story ID: A man who suffers from blackouts hires a husband and wife detective team to follow him when he's in his fugue state

A short story I think... A man who suffers from blackouts hires a husband and wife detective team to follow him when he's in his fugue state... I thought it was a Philip K Dick short but couldn't find it online. Possibly by Douglas Adams... Ring any bells?