Why does my phone's GPS suffer from "urban canyon" problems in Beijing but not New York?

In a  I asked why my phone's GPS didn't seem to work in Beijing, China. Turns out that it was simply an "urban canyon" problem, and that the GPS did in fact work when I moved to higher and/or more open areas. What I'm wondering, is why is my phone capable of receiving GPS satellite signal in New York City, a much more dense city than Beijing especially in terms of skyscraper density downtown, but not so in Beijing? It seems if anything that it should be the other way around, or that I shouldn't be able to receive signal in either city.  Please note: I am not asking about location services on the phone, which can be influenced by things such as nearby WiFi networks and certain service carriers. I am specifically asking about GPS satellite reception coverage.  Clarification:  Outside of downtown Beijing my phone is able to receive GPS signal just fine. This question is not an issue of the GPS receiver on my phone altering the signal or any type of Chinese law. I know that the GPS receiver works perfectly. I'm simply confused as to why downtown Beijing has particular problems compared to a denser city such as downtown NYC.


Calculate sample statistics for estimated parameters of a model

How some standard package (eg R, SAS or Excel) calculate Standard error for the estimated parameters for a model.     my understanding : While using gradient descent optimization method( as performed in Machine learning tutorial from Andrew Ng) we get a point estimate (right?) But suppose I have to find the confidence interval of the estimated parameters we'll have to form multiple samples using bootstrap(or any other method?) to find parameters for each sample. Then we can calculate the sample mean , std error and thus call Z-score to calculate the confidence interval of the estimate.  Am I thinking in the correct direction?


Any good Lynda alternatives for improving myself as a Graphic Designer?

I like to work more on Photoshop, Illustrator, InDesign and so forth in my spare time.   I'm already under education to becoming a Graphic Designer.  I love working in the listed programs, and making all kind of stuff.   But when i come home i have a hard finding something i can do in these programs, i don't really have any projects.   Sometimes i make a logo for a fictive company or existing company, but i find it hard to stay motivated, when it's not going out in the real world.   I sometimes see tutorials on youtube, but i feel they are not always the best quality, and that can also be kinda boring, when i know how to do most of the stuff in the tutorial already.  So i would just like to hear what you guys do when you just want to get better in these programs.   I wanted to give Lynda a try, but i feel like it's way to expensive.


A troop of monkeys ______ coming towards us ( is/ are)

A troop of monkeys _____ coming towards us.   Which auxiliary verb should be here (is / are)?


I want to carry out some action (say chown) on all the hidden files in a directory.  I know that this .* is not a good idea because it will also find the current . and parent .. directories (I know that rm will fail to operate on . and .. but other commands, including chown and chmod, will happily take effect)  But all my hidden files have different names!  How should I glob for all hidden files while excluding . and .. ?


Let $f$ be a nonnegative continuous function on $[a,b]$, then $ \lim\limits_{n\to \infty} \left[\int^{b}_{a}f^{n}(x)dx\right]^{\frac{1}{n}}=M$

Let $f$ be a nonnegative continuous function on $[a,b].$ Let $M=\max \{f(x):x\in[a,b]\}$. Show that \begin{align} \lim\limits_{n\to \infty} \left[\int^{b}_{a}f^{n}(x)dx\right]^{\frac{1}{n}}=M\end{align}  MY TRIAL  My idea is to estimate and arrive at $\epsilon.$  \begin{align} \left|\left(\int^{b}_{a}f^{n}(x)dx\right)^{\frac{1}{n}}-M\right|&\leq \left|\int^{b}_{a}f(x)dx-M\right| \\&= \left|\int^{b}_{a}f(x)dx-\int^{b}_{a}\frac{M}{(a-b)}dx\right| \\&= \int^{b}_{a}\left|f(x)-\frac{1}{a-b}M\right|dx\end{align} I'm stuck here but I sense that the above idea of mine, sounds quite unscholarly of me but I could do nothing more? Please, are there any better explanations out there? Thanks!


Find all the entire functions satisfying $f^2+g^2=1$

Find all the entire functions (holomorphic functions on $\mathbb{C}$) $f,g$ satisfying $f^2+g^2=1$.  Of course $f,g$ can be constants satisfying $f^2+g^2=1$. But if they are not constants, do they exist?  Maybe Liouville Theorem can be used here to solve this problem, but how to use?


Let $(X,d)$ be a metric space where $X$ is some set and $d : X \times X \rightarrow \Bbb R$ is a metric. And let $(x_n)$ be a sequence.  What is the definition of a bounded sequence in a metric space?  I would assume it's something of the form $\exists M , |x_n| \lt M$ for all $n$.  But $|x|$ might not have meaning depending on what metric space is used.


Is flagging good for answers that don't add any value?

I often see late answer to some post which already has decent number of votes which has accepted answer, and these new answers (mostly by new users) don't any any value and just eat the screen-space + the precious memory of SE hosting + the money + the maintenance cost + time of the user coming/reading the post in future (most important for me).   I thought flagging these for deletion should be good. But, I am not sure what should be the right course of action. What do the meta users have to say about these? Your views?


i just want to create a simple application that will allow a user to input a url to a rss feed and display the contents to a user.  what would be a good java library to enable me to read rss feeds?  cheers


How does Salesforce SSO call just-in-time handler methods

I am having a hard time digging up some information on this as I believe it is still relatively new. If you implement SSO with Salesforce you have the ability to enable SAML. I have enabled SAML and have also enabled JIT with an automatically created class to support it.  Out of this newly generated class, there are two global methods that I am assuming are called upon SSO, but I do not know which one is called or how.   global User createUser(Id samlSsoProviderId, Id communityId, Id portalId,     String federationIdentifier, Map<String, String> attributes, String assertion) {     User u = new User();     handleJit(true, u, samlSsoProviderId, communityId, portalId,         federationIdentifier, attributes, assertion);     return u; }  global void updateUser(Id userId, Id samlSsoProviderId, Id communityId, Id portalId,     String federationIdentifier, Map<String, String> attributes, String assertion) {     User u = [SELECT Id, FirstName, ContactId FROM User WHERE Id=:userId];     handleJit(false, u, samlSsoProviderId, communityId, portalId,         federationIdentifier, attributes, assertion); }   Does Salesforce have some backend code that interprets the SAML coming over the SSO and then calls the methods appropriately?   The reason I am asking this is because I would like to cancel a user's SSO if they do not match x fields based off of the values coming across in the SAML in the SSO. If I did not want to update a user or create a user, would I be able to add in my own global class that could be called from the SSO?   Let me know if this is unclear / does not make sense.  Thanks


I am a Moroccan citizen travelling from USA to Morocco, and I have a layover in Denmark for three hours, do i need a visa to transit

I am a Moroccan citizen, I was in USA as tourist, and I plan to go back to Morocco through Norwegian airways, I have a layover for three hours in Copenhagen, do I need a visa??


Which one is correct to speak? Why?   I will call you. I would call you.   What is the difference between the two? Thanks.


Remove Ubuntu from SSD and Install Windows 10

I know there are similar questions already floating around the magical interweb, but I have quite a specific issue.  I built a new PC just yesterday, but decided not to go for an optical drive since I haven't used the one on my laptop in years. I figured the best way to install Windows then would be to boot Ubuntu from a flash drive, download Windows from there, and then install it onto the SSD. However, I encountered problems with the storage space on the flash drive(s) I was using, and accidentally ended up installing Ubuntu onto the SSD.  Now I have a bootable Windows OS on my flash drive, but cannot install it as the SSD is not formatted correctly. I assume I'm going to need to boot Ubuntu again, partition the SSD, and then install Windows from there? How do I do this? I'm tearing my hair out...


In simple terms, what are the assumptions of Linear Regression?  I just want to know that when I can apply a linear regression model to our dataset.


Given $a,b,c$ are the sides of a triangle. Prove that $\frac{a}{b+c}+\frac{b}{c+a}+\frac{c}{a+b}<2$

Given $a,b,c$ are the sides of a triangle. Prove that $\dfrac{a}{b+c}+\dfrac{b}{c+a}+\dfrac{c}{a+b}<2$.    My attempt: I could solve it by using the semiperimeter concept. I tried to transform this equation since it is a homogeneous equation as $f(a,b,c)=f(ta,tb,tc)$. I considered $a+b+c=1$ and thus the inequality reduces to   $$\dfrac{a}{1-a}+\dfrac{b}{1-b}+\dfrac{c}{1-c}<2$$.    This is getting quite difficult to prove, as I don't have any clue to approach. I want to solve this only by homogeneous equation transformation, so any other transformation is welcome, but not any other idea(I don't mean to be rude but that's my necessity). Please help. Thank you.


How do I determine which filesystem is in use on my "Microsoft basic data" partition?

I'm looking at WD Mybook disk, connected via USB as disk sde. Now, fdisk -l /dev/sde tells me that the single partition on the drive is: Device     Start         End     Sectors  Size Type /dev/sde1   2048 15628050431 15628048384  7.3T Microsoft basic data  but what's that? I don't quite understand what the  is telling me about this partition type. It seems to be auto-mounted fine, and still I don't undestand what filesystem is in use.


What is the best algorithm for finding the last digit of an enormous exponent?

I found most answers here not clear enough for my case such as  $$ 123155131514315^{4515131323164343214547} $$  I wrote the $n\bmod10$ in Python and execution time ran out. So I need a faster algorithm or method. Sometimes, the result is incorrect as it failed the test case.


Temporarily persisting access token for calling the third party API

I doing a Apex Callout to the third party API which uses the OAuth. I am beginner in the integration from Salesforce to external systems. I am successfully able to call the third party API and perform GET/POST methods.  @future (callout=true)     public static void createSegmentD365() {         try{                 String clientId = 'xxxxxxx';                 String clientSecret = 'xxxxxxxx';                 String tenant_id = 'xxxxxxxxxxx';                 String resource = 'xxxxxxxxxxxx';                  String reqbody = 'grant_type=client_credentials&client_id='+clientId+'&client_secret='+clientSecret+'&tenant_id='+tenant_id+'&resource='+resource;                  Http h = new Http();                 HttpRequest req = new HttpRequest();                 req.setBody(reqbody);                 req.setMethod('POST');                 req.setEndpoint('https://login.microsoftonline.com/xxxx/oauth2/token');                 HttpResponse res = h.send(req);                  deserializeResponse resp1 = (deserializeResponse)JSON.deserialize(res.getbody(),deserializeResponse.class);                 String bearerToken = resp1.access_token;                  Http http1 = new Http();                 HttpRequest req1 = new HttpRequest();                 req1.setEndpoint('https://xyz/data/parentAccounts');                        req1.setMethod('GET');                 req1.setHeader('Authorization','Bearer '+bearerToken);                 HttpResponse res1 = http1.send(req1);   The access token I retrieved from the Authorization provider is valid for 1 hour. I am trying to understand is there a way where I can cache the access token, so I can use the cached token instead of calling the authprovider again within the 1 hour for Access Token. we wont be able to use the named credentials and looks like custom settings is deprecated. I started creating a custom metadatatype with the following fields     I am not able follow in any of the article how I store the credentials or how I cache the access token / refresh if the token is expired from the custom metadata. Any help greatly appreciated.


I created two websites for a local football team with news and photos, etc. I created them on a hosting facility provided by a newspaper company for amateur sports clubs. After ten years they now inform me that their hosting service will end in one month's time. They advise me to make arrangements to preserve the two sites if I wish keep the content, as the sites will not be available after the hosting service ends. How can I save these sites for future referencing ?


Dual nationality : ESTA and non ESTA citizen with one valid nonimmigrant USA visa

I have dual French/Honduran nationality. I'm living in France, and I'll be soon traveling to Honduras for holidays. My flight will go through the US (One night stay). My Honduran passport has a valid non-immigrant US visa that I got before becoming a French citizen.    My question: what passport should I use to enter the USA? The Honduran with my valid US visa? Or my French one, along with an ESTA application?  Another piece of information: I'm traveling alone with my 3 year old daughter, who is only French and who will be needing an ESTA application for the US.


Star Trek: Have objectionable jobs been automated away?

other questions about cashless society of humans but this seems to have been due to a philosophical change. but is it implied that technology makes it possible for all to have food and shelter even without working?


What is the difference between \begin{gather} and \begin{gather*}?

I guess the asterisk has a general meaning at that position and probably should know it, but I just can't find it in amsmath manual.


Why did community user delete this meta question where multiple answers had up votes?

The  was deleted last night by the Community user.    Normally, I wouldn't see an issue with this, but for this particular deletion, I can see three issues:   We try not to delete good content There are multiple upvoted answers We often use previous answers on Meta (as well as badly asked questions) to form the precedent (and to use as duplicates) when users ask questions like this in the future   On a personal note, I find it easier to link to one of my previous answers whenever possible.  This seems like a bug with the deletion algorithm, , the deletion algorithm should never delete questions with upvoted answers.  I'm going to go ahead and undelete it, but I'm bringing this up in case there was either:    A policy change A bug   So is it either of the above or something else?


I know that $\frac{1}{\infty}$ is undefined. But my question is - can we say that $\frac{1}{\infty}\neq0$ ?  I've got some idea how to explain that: Let's say we have a random-number generator that generates numbers in interval $(0, \infty)$. What is the probability that it generates 5? $\frac{1}{\infty}$. So it cannot equals zero because if it was zero, it wouldn't generate any number (every number has the same probability - $\frac{1}{\infty}$).  Am I right? Or is that wrong idea?  Thanks


Is a visa needed for a stopover in USA for a person holding a Canadian permanent resident visa?

I have a concern about my approaching flight, I just got my permanent resident visa for Canada. I have a connecting flight from Manila to San Francisco USA, then to Toronto. I will just stay two hours at the San Francisco airport for my connecting flight.  Do I need papers or a visa from the US embassy so they will not hold me or stop me from flying to Canada?


Finding maximum likelihood of a mixture normal distribution

I'm trying to understand how to solve the following problem:  I have to estimate each parameter of   $f(x)=pϕ(x│μ_1,σ_1^2 )+(1-p)ϕ(x|μ_2,σ_2^2)$  using maximum likelihood estimation. $ϕ(.|μ,σ^2)$ is the pdf of a normal distribution.  So, as I understand it, what I have to do is  $\mathcal{L}(\mu_1,\mu_2,\sigma_1,\sigma_2)= ∏_{i=1}^n\left(p\frac{1}{\sqrt{2π}\sigma_1i} e^{-\frac{(x_i-a_1i)^2 }{2\sigma_1i^2 }}+(1-p)\frac{1}{\sqrt{2π}\sigma_2i} e^{-\frac{(x_i-a_2i)^2}{2\sigma_2i^2 }}\right) = p^n(\frac{1}{\sqrt{2π}\sigma_1i})^n e^{-\frac{1}{2\sigma_1i^2}\sum(x_i-a_1i)^2}+(1-p)^n(\frac{1}{\sqrt{2π}\sigma_2i})^n e^{-\frac{1}{2\sigma_2i^2}\sum(x_i-a_2i)^2}$  Then $ln\mathcal{L}(\mu_1,\mu_2,\sigma_1,\sigma_2)= ln(p^n)ln(\frac{1}{\sqrt{2π}\sigma_1i})^n -\frac{1^2}{2\sigma_2i^2 }(x_i-a_1i)^2+ln((1-p)^n)ln(\frac{1}{\sqrt{2π}\sigma_2i})^n -\frac{1^2}{2\sigma_2i^2 }(x_i-a_2i)^2 $  Is this ok so far? If so, could you show me how to proceed from here?


Why do medium format (digital) cameras capture better dynamic range?

Why do medium format (digital) cameras capture better dynamic range than smaller sensor cameras?


Why drive a relay with a transistor switch?

It appears most people drive relays through a transistor rather than directly from a digital output pin on an Arduino.  I had wired the output pin directly to my relay before realizing this and it worked fine.  What's the transistor for?    Is it to protect the output pin from exceeding the max current if the relay coil has too low a resistance?  Or, is it to conserve energy taking advantage of the common emitter amplification?  To produce less heat perhaps?


What are the differences between stochastic and fixed regressors in linear regression model?

If we have stochastic regressors, we are drawing random pairs $(y_i,\vec{x}_i)$ for a bunch of $i$, the so-called random sample, from a fixed but unknown probabilistic distribution $(y,\vec{x})$. Theoretically speaking, the random sample allows us to learn about or estimate some parameters of the distribution $(y,\vec{x})$. If we have fixed regressors, theoretically speaking, we can only infer certain parameters about $k$  conditional distributions, $y\mid x_i$ for $i=1,2,\dots,k$ where each $x_i$ is not a random variable, or is fixed. More specifically, stochastic regressors allow us to estimate some parameters of the entire distribution of $(y,\vec{x})$ while fixed regressors only let us estimate certain parameters of the conditional distributions $(y,\vec{x_i})\mid x_i$. The consequence is that fixed regressors cannot be generalized to the whole distribution. For example, if we only had $x=1,2,3,\dots,99$ in the sample as fixed regressors, we can not infer anything about $100$ or $99.9$, but stochastic regressors can. This is a rather obscure question as many textbooks only talk about the differences in mathematical derivation but avoid discussing the differences to the extent they can be generalized theoretically.


Is there a benefit beyond the rule of cool to the majority of Star Wars craft having actuating wings?

In space no one cares if you're aerodynamic. That said, why bother having actuating wings on craft primarily meant for space travel? Sure the X-Wing looks cool, but looking cool is hardly a sufficient justification for the expense, especially when you're running a costly and cash strapped rebellion.


Extra line being inserted after enumerate or math display before qed symbol

I am using thmtools and amsthm to create custom theorem environments with custom qed symbols, like so:  \declaretheoremstyle[ spacebelow=2\topsep, spaceabove=2\topsep, headfont=\normalfont\bfseries, bodyfont=\normalfont, postheadspace=\newline, qed=${\lrcorner}$, headpunct={}, notebraces={[}{]} ]{breakup}   Normally these behave fine, for example  but I start to have problems if the text in my environment ends with either an enumerate or some math display content:    As you can see, an extra line is being inserted before the qed symbol is being printed. I've tried searching for a solution, but haven't managed to find a question that deals with this exact problem.


Can I use Different charger: Similar Voltage, lower Amps?

My computer uses at 19.5V 9.23A charger.  I would like to use a 19V 4.74A charger on the same laptop.  The polarities and connectors are the same.   is the most comprehensive explanation I've been able to find online, however it doesn't address my particular issue, where the voltage and the amperage are lower.  The voltage is only slightly lower, so I'm curious as to if the Current too Low section applies to me or if because it's slightly lower does that section not apply to me and so what is the actual possible results of using the charger?  Thanks!


Installed Kubuntu 19.04 in 175 GB drive by mistake. How to do partition

I installed Kubuntu 19.04 in 175 GB drive by mistake. Can i partition that drive now and allocate kubuntu in a smaller space?


accessing html element after it was inserted by DOM manipulation

I have a Jquery function that when a button add_entry is clicked, inserts a 'save button' inside the page like this; the button shows up, so I assume that part is working.   $("#add_entry").click(function(){     $("#add_entry").hide();     $('#status').append(<button class="save_entry">Test</button>); });   then I have yet another function that is supposed to be called when aforementioned save button is clicked:   $(".save_entry").click(function(){     alert("i dont work :/"); });   which makes me wonder...  a) How does DOM manipulation actually work? - Since the jquery part is wrapped into the $document.ready() method does that mean i cant access 'on-the-fly' created elements like that ?   b) when injecting elements with DOM manipulation, they never appear in the source... why?   Thank you for your time.


Let $R$ be a commutative ring with identity. Suppose $(a)=(b)$ with $a,b$ in $R$. Then $a=bu$, with $u$ a unit in $R$. Is this true?


Is your MAC address revealed when you hit up a website?

When you hit up a site, such as cnn.com, does the TCP/IP packet contain the MAC address of your network card?  Could cnn.com theoretically record my MAC address?


What is the intuition regarding the different viewpoints of the Kullback-Leibler Divergence and the Kolmogorov-Smirnov Statistic?

In trying to understand the Kullback-Leibler Divergence I conceive it as a metric that if minimized would make the Approximation PDF Q as close as possible to the True PDF P either in the neighborhoods of X where P places the highest probability mass (K(P||Q)) or in the neighborhoods of X where Q places the highest probability mass (K(Q||P)).  So it is like saying to Q "try your best to approximate P where P thinks are the most probable neighborhoods" or inversely "try to approximate P the best in the neighborhoods you believe are the most probable."  On the other hand, trying to arrive to an intuitive understanding of the Kolmogorov-Smirnov statistic, I view it as a decision to underplay local divergences between two probability distributions functions in favor of the 'larger picture' which is reflected in the divergence of their respective Cumulative Distributions.  I wonder if these thoughts make sense, and how you would like to add to them with your own intuitive interpretations of the two Divergence 'metrics'.  In a more practical level when and how do you believe  Kullback-Leibler Divergence and Kolmogorov-Smirnov statistic should be used?  A case in hand might be to compare the predicted probabilities by a classifier --say Logistic Regression-- to the empirical ones using the Validation set.  Consequently compute the divergence between the two distributions --predicted and empirical-- using an appropriate divergence 'metric'.  Finally use this information to select a model that best approximates the conditional probability P(Y|X).  Which metric should we use and why?


Why isn't the ROC curve naturally plotted in 3D?

Something that really confuses me with how ROC plots are generated is that, according to Wikipedia:  The ROC curve is created by plotting the true positive rate (TPR) against the false positive rate (FPR) at various threshold settings.  So the algorithm seems to be: Set a decision threshold for binary classification, e.g., a number between $[0, 1]$ that tells which data is labeled as $1$ or $0$. Run the trained classifier on your dataset. Calculate TP and FP, which is just based on the result of your classification. Then plot a point with coordinate (TP, FP) on a 2D plot. Repeat this process for....(?) many many times, until you get many points. Then linearly interpolate between these points to generate a 2D curve. Do I get this process correct?  So my question is: why isn't this naturally a 3D plot? The threshold parameter seems to be pretty important.  First of all, I cannot tell at any given plot on the ROC curve what the threshold was used. Are the points even plotted according some sorted order of these thresholds? I cannot tell.  Also, shouldn't the threshold be critical at creating your final classifier? The ROC curve should have a point that corresponds to the best threshold. But I don't know what that threshold is on this plot.  Finally, this is not related to the ROC plot per-se but just the entire concept. It seems pretty dumb to me to either use a very large or very small threshold. A decision threshold of $0$ or $1$ would not make any sense in creating a classifier, no?   It just doesn't seem to make sense to neglect this information.


For independent RVs, does $E|X+Y|<\infty$ imply $E|X|<\infty$.

Let $X,Y$ be independent random variables. Suppose $E|X+Y|$ is finite. Does it follow $E|X|<\infty$?   I believe the answer is no and tried to come up with a counter-example. Below is my attempt where I couldn't complete. If it follows that $E|X|$ is finite, please ignore my attempt.  Attempt (Constants are ignored for readability.) Let $X$ be defined on $\mathbb{N}$ with distribution $P(X=k) = 1/k^2$. Note $EX = \sum_k k/k^2=\infty$. Let $Y$ be identical to $X$. Distribution of $X+Y$ is given by; \begin{equation} \begin{aligned} P(X+Y = z) &= \sum_{k=1}^{z-1} P(X=z-k)P(Y=k)\\ &=\sum_{k=1}^{z-1} \frac{1}{(z-k)^2k^2} \end{aligned} \end{equation} Hence expected is given by; \begin{equation} E(X+Y) = \sum_{z=2}^{\infty}\sum_{k=1}^{z-1} \frac{z}{(z-k)^2k^2} \end{equation} I couldn't argue that the sum is finite. Is above sum convergent?


When you accept an answer should you also vote it up?

By accepting an answer you're obviously already saying that it was useful. Should an additional up-vote be reserved for answers that are particularly useful, or do people always tend to use the two in unison (or the contrary)?


What is the origin of the phrase ‘By the by...’?

What is the origin of the phrase 'By the by...'?


Evaluate the Finite Sum with Binomial Coefficient

Evaluate the following sum:  $$\sum_{k=0}^n\binom{n}{k}\frac{k}{n}x^k(1-x)^{n-k}$$  This almost looks like the Binomial Theorem, except there's that pesky little $\frac{k}{n}$ term in there that changes things up a bit.  I'm not quite sure what steps to take from here.  How do you evaluate this sum?


Is it possible to construct a multi-colored double-bladed lightsaber?

I was just watching  video of some SW dueling at the 2015 World Fencing Championship, and wondered if it's actually possible in the SW universe to construct a multi-colored double-bladed lightsaber?   Are there any accounts of such a thing? If not, would it at least be theoretically possible to make one, or, are there obvious limitations?


Can a graphical front end be added to server like X11?

I just installed Ubuntu server 16.04.3 and found out that it is command line based. Can a graphical front end be added so it is easier to use like X11? Not much in command lines since Dos 6.0. Thanks for the help, we are new to linux...


How does bash interpret the equal operator with no surrounding spaces in a conditional?

The following script does not behave as I would have expected.  Adding spaces around the '=' in the conditional made it perform how I wanted, but it got me thinking, what is it actually doing inside the conditional?  #!/bin/bash S1='foo' S2='bar' if [ $S1=$S2 ]; then     echo "S1('$S1') is equal to S2('$S2') fi echo $S1 echo $S2   The output is:  S1('foo') is equal to S2('bar') foo bar   The contents of S1 and S2 don't change from what they are assigned, so the = doesn't perform an assignment.


Can you stop python condensing 00 in a variable to 0

I am trying to make a code script for a timer but I cant get python to stop making a variable that I have made as: self.__time_seconds = 00 but when I tell it to print all I get is 0 as the printed output. So can I have your help to stop this please? Thanks!


I wrothe this application in java that makes one of the buttons escape from the coursor. The app works just fine, but I'd like to add another functionallity: changing "ok" button text to "Test" when button "nie" is clicked. I just cant figure out how to do that. Please help. here's the code:  import javax.swing.*; import java.awt.*; import java.awt.event.*; public class escButton extends JFrame implements ActionListener  {      public escButton(){          super("Wybierz odpowiedź");          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         setSize(400,400);         BorderLayout border = new BorderLayout();          setLayout(border);         JLabel msg = new JLabel("Some Question");         add(BorderLayout.NORTH, msg);         PrankPanel panel = new PrankPanel();         add(BorderLayout.CENTER, panel);          panel.ok.addActionListener(this);         panel.nie.addActionListener(this);         setVisible(true); }      public void actionPerformed(ActionEvent event) {         String source = event.getActionCommand();             if (source == "Nie") {                 this.setVisible(true);                 JOptionPane.showMessageDialog(null,"Zgadza się!", "Odpowiedź",                         JOptionPane.INFORMATION_MESSAGE);                 setTitle("abcd");                 ok.setText("test");              }             else {                 System.exit(0);             }  }        public static void main(String[] args) {        new escButton();      }   } class PrankPanel extends JPanel implements MouseMotionListener{    public JButton ok = new JButton("Tak");     JButton nie = new JButton("Nie");     int buttonX, buttonY, mouseX, mouseY ;      int width, height;         public  PrankPanel(){             super();             setLayout(null);             addMouseMotionListener(this);             buttonX = 110;             buttonY = 110;             ok.setBounds(new Rectangle(buttonX, buttonY, 70, 20));             nie.setBounds(new Rectangle (200,110,70,20));             add(ok);             add(nie);          }           public void mouseDragged(MouseEvent e) {      }      public void mouseMoved(MouseEvent e) {         mouseX = e.getX();         mouseY = e.getY();         width = (int) getSize().getWidth();         height = (int) getSize().getHeight();         if (Math.abs((mouseX)- buttonX) < 50){             buttonX = moveButton(mouseX,buttonX,width);             repaint();         }         if (Math.abs((mouseY )- buttonY) < 50){             buttonY = moveButton(mouseY,buttonY,height);                repaint();            }      }      private int moveButton(int mouseAt, int buttonAt, int bord){         if (buttonAt < mouseAt) {             buttonAt-=10;         }         else {             buttonAt+=10;         }          if (buttonAt > (bord - 20) ) {             buttonAt = 10;          }         if (buttonAt < 0) {             buttonAt = bord - 100;         }         return buttonAt;     }      public void paintComponent(Graphics g){         super.paintComponent(g);         ok.setBounds(new Rectangle(buttonX, buttonY, 70, 20));     }  }


From whom abstraction hides implementation?

I know the architecture, how we can implement abstraction using the interface and an abstract class. But from whom we are hiding the implementation? As a developer, anyone can click on that method and can see the classes which are giving implementations for those abstract methods. As a user, he will be only facing UI, so he is not going to see the code anyway. Then my question from whom we are hiding the implementation?


Flagging and up-voting comments in not possible on the Surface tablet

On desktop devices, the buttons to flag or like a comment appear when you hover over it.  However on my Surface, I cannot hover over it but I am on the desktop site, meaning I cannot flag or up vote comments.  Can this be changed?


Preserve spacing and newline characters while using 'subshell' method

by describing my issue, I refer to the following code:   #!/bin/bash #fileName: subMet.sh  cmd="$(ls -l | cat -n)"  echo $cmd   Then, in the script above I used double quotes to assign a value to cmd, because I've read that, in this way, it's possibile to preserve spacing and newline characters, in the output. Anyway it doesn't happen.   Can anyone tell me where I am wrong? More, can anyone tell me how to preserve the spacing and newlines?  I hope I have exposed my issue in a decent way, and I thank you in advance.


I'm doing some test, and I created a local repos to version some files. I would like to restore all my files to their state at a previous commit. Is it possible ? I know that git checkout file restore a file to the current commit state. However I'm not sure if git checkout * do the same for all file, and even more here I'm not sure if it's possible to restore from more than just the latest commit.


I'm getting this error when I try to connect to a google cloud instance through jdbc. Not really sure why it's occurring but here's the full error:  Exception in thread "main" java.lang.NoSuchMethodError: 'com.google.api.client.json.JsonParser com.google.api.client.json.JsonFactory.createJsonParser(java.io.InputStream, java.nio.charset.Charset)'         at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:77)         at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:73)         at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:101)         at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentialsUnsynchronized(DefaultCredentialsProvider.java:107)         at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentials(DefaultCredentialsProvider.java:55)         at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:66)         at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:48)         at com.google.cloud.sql.core.CoreSocketFactory$ApplicationDefaultCredentialFactory.create(CoreSocketFactory.java:299)         at com.google.cloud.sql.core.CoreSocketFactory.getInstance(CoreSocketFactory.java:126)         at com.google.cloud.sql.core.CoreSocketFactory.connect(CoreSocketFactory.java:185)         at com.google.cloud.sql.postgres.SocketFactory.createSocket(SocketFactory.java:73)         at org.postgresql.core.PGStream.<init>(PGStream.java:73)         at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:93)         at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)         at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)         at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:211)         at org.postgresql.Driver.makeConnection(Driver.java:459)         at org.postgresql.Driver.connect(Driver.java:261)         at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)         at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:251)         at App.main(App.java:12)   And here's the script (the instance name and password have been voided by "..." for privacy:  import java.sql.Connection; import java.sql.DriverManager;  public class App {     public static void main(String args[])     {         Connection c = null;         try         {            Class.forName("org.postgresql.Driver");            c = DriverManager.getConnection("jdbc:postgresql:///<postgres>?cloudSqlInstance=<...:database>&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=<postgres>&password=<...>");         }         catch (Exception e)         {            e.printStackTrace();            System.err.println(e.getClass().getName()+": "+e.getMessage());            System.exit(0);         }         System.out.println("Opened database successfully");      } }


Evaluating $\int \frac{\sin{x}+\cos{x}}{\sin^4{x}+\cos^4{x}} \mathrm dx$

I am having real trouble evaluating this indefinite integral  $$\int{\frac{\sin{x}+\cos{x}}{\sin^4{x}+\cos^4{x}}}dx$$  Need I mention that I already tried WolframAlpha with little success? It returned a complicated expression full of many $\arctan$ terms.  Here is what I have already tried:   Seperating denominator as $(1-\sqrt{2}\sin{x}\cos{x})(1-\sqrt{2}\sin{x}\cos{x})$ and applying partial fractions. Multiplying and dividing by $\sec^4{x}$   Please provide any help. It would be appreciated if you give a hint rather than the whole solution.


Problem with IMPORTRANGE function in Google Sheets

I’m trying to get IMPORTRANGE to work for me with no success. I made two simple spreadsheets:  and . In the destination sheet I’m using the import range function:  =importrange(“1-5F1_zz0ZpGj7SfeQhewsCe0CsrA0eyPbjfmUrLBsyk”,”Sheet1!a1:a1”)   I tried already:   Replacing the , with ; Referencing just the key as well as the full URL in the first argument Switching from “ to ‘ With the sheet name and without it   Not sure what else to do.  Any ideas?


Aut($C_p) = C_{p-1}$when $p$ is prime, why?

Aut($C_p) = C_{p-1}$ when $p$ is prime, why?  I don't see why this result follows, I'm sure it's obvious though. I appreciate that Aut($C_p)$ will be of order p-1


Why is mirror and subdiving co-acting wierdly?

Heres a picture. im making a body, and it seems to have flash in the middle.


Is any group the group of units of some ring?

I was wondering if there was a way to see any group $G$ as a subgroup of the inverse group of a ring, $G \leq A^\times$? Thanks!


Parse XML to get node value in bash script?

I would like to know how I can get the value of a node with the following paths:   config/global/resources/default_setup/connection/host config/global/resources/default_setup/connection/username config/global/resources/default_setup/connection/password config/global/resources/default_setup/connection/dbname   from the following XML:  <?xml version="1.0"?> <config>     <global>         <install>             <date><![CDATA[Tue, 11 Dec 2012 12:31:25 +0000]]></date>         </install>         <crypt>             <key><![CDATA[70e75d7969b900b696785f2f81ecb430]]></key>         </crypt>         <disable_local_modules>false</disable_local_modules>         <resources>             <db>                 <table_prefix><![CDATA[]]></table_prefix>             </db>             <default_setup>                 <connection>                     <host><![CDATA[localhost]]></host>                     <username><![CDATA[root]]></username>                     <password><![CDATA[pass123]]></password>                     <dbname><![CDATA[testdb]]></dbname>                     <initStatements><![CDATA[SET NAMES utf8]]></initStatements>                     <model><![CDATA[mysql4]]></model>                     <type><![CDATA[pdo_mysql]]></type>                     <pdoType><![CDATA[]]></pdoType>                     <active>1</active>                 </connection>             </default_setup>         </resources>         <session_save><![CDATA[files]]></session_save>     </global>     <admin>         <routers>             <adminhtml>                 <args>                     <frontName><![CDATA[admin]]></frontName>                 </args>             </adminhtml>         </routers>     </admin> </config>   Also I want to assign that value to the variable for further use. Let me know your idea.


I am experiencing difficulties trying to figure out the correct multiplication order for a final transform matrix. I always get either strange movement or distorted geometry. My current model is explained below:  For a single node my multiplication order is:     L = S * R * T   where     L = local transformation matrix      S = local scale matrix      R = local rotation matrix      T = local translate matrix   For a node's world transformation:     W = P.W * L   where     W = world transformation matrix      P.W = parent world transformation matrix      L = the local transformation matrix calculated above   When rendering, for each node I calculate the matrix :      MV = Inv(C) * N.W   where     MV = the model view transformation matrix for a particular node      Inv(C) = the inverse camera transformation matrix      N.W = the node's world transformation matrix calculated above.   Finally, in the shader I have the fallowing transformation:     TVP = PRP * MV * VP   where     TVP = final transformed vertex position      PRP = perspective matrix      MV = the node's world transformation matrix calculated above      VP = untransformed vertex position.   With the current model, child nodes which have local rotation, rotate strangely when transforming the camera. Where did I go wrong with the multiplication order?


Firebase Auth.signOut keeps crashing Activity

My app is getting some errors whenever I click the signout button. I suspect that this causes by the authentication.signout(). This is the error: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.demo.finalssuncrestbank, PID: 17982 java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.firebase.firestore.DocumentSnapshot.getString(java.lang.String)' on a null object reference     at com.demo.finalssuncrestbank.UserProfile$1.onEvent(UserProfile.java:52)     at com.demo.finalssuncrestbank.UserProfile$1.onEvent(UserProfile.java:49)     at com.google.firebase.firestore.DocumentReference.lambda$addSnapshotListenerInternal$2(DocumentReference.java:483)     at com.google.firebase.firestore.DocumentReference$$Lambda$3.onEvent(Unknown Source:6)     at com.google.firebase.firestore.core.AsyncEventListener.lambda$onEvent$0(AsyncEventListener.java:42)     at com.google.firebase.firestore.core.AsyncEventListener$$Lambda$1.run(Unknown Source:6)     at android.os.Handler.handleCallback(Handler.java:790)     at android.os.Handler.dispatchMessage(Handler.java:99)     at android.os.Looper.loop(Looper.java:169)     at android.app.ActivityThread.main(ActivityThread.java:6521)     at java.lang.reflect.Method.invoke(Native Method)     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)  The code is this: DocumentReference documentReference = fStore.collection("Users").document(UserID);         documentReference.addSnapshotListener(this, new EventListener<DocumentSnapshot>() {             @Override             public void onEvent(@Nullable DocumentSnapshot value, @Nullable FirebaseFirestoreException error) {                 mName.setText("Name: " + value.getString("Name"));                 mPhone.setText("Phone: " + value.getString("Phone"));                 mEmail.setText("Email: \n \n" + value.getString("Email"));                 mBalance.setText(String.valueOf(value.getDouble("Balance")));              }         });     LogOut.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             fAuth.signOut();             Intent intent = new Intent(getApplicationContext(), Login.class);             startActivity(intent);         }     });  I wanted to know what are the possible reasons why this keeps happening and what should I do?


Currently, the  runs at 17.59 Petaflops, which consumes 9 megawatts of electricity. A qubit-based quantum computer has the potential to operate much more quickly for some operations than a classical computer would be able to (). In fact, classical computers face a major hurdle in computation speed due to the inherent capacitance of components. My question is: would a quantum computer able to compute things faster than a classical computer do so with less, about the same, or greater power draw for equivalent operations? Would that depend on its implementation?


What was the point of Grigor Andolov's story at the end of s03e09 of Billions?

One of the interesting moments in Billions was the end sequence of season 3 episode 9. John Malkovich's character (Grigor Andolov) started to tell a story, ostensibly a memory from his own past. The thing is, the story was completely unrelated to what they were talking about at the moment. What's more, it didn't even have an ending. All in all, I enjoyed watching it, but couldn't make much sense of it.


I asked this on the local meta site where it happened, but maybe someone here will have more info: This is pretty innocuous, and I'm more asking out of curiosity, but I  more reputation for the year than I have reputation total. Specifically at the time of this posting, 7268 total and 7288 for the year. Month-by-month, I gained 15 reputation for the year over my total , 3 more , and 2 more .


Allow adding accented URL to the "Website link" field in the user's profile

I'd like to add a link in my profile with a domain name which contains an accent, but when I save the changes, the accent is removed resulting in a different URL.  For example, from accentués.com, it goes to accentus.com.  Could we have accents in the "Website link" field?


Should 'Hi', 'thanks', taglines, and salutations be removed from posts?

I edit a lot of posts every day. I often run across posts with 'Hi' and 'Thanks' on the top and the bottom of the post respectively. I also run across things like:     --User   Should these items be removed during the editing of the post by an editor?


How to move up/*bump* questions on Stack Exchange sites

At times questions are asked without any proper responses that are useful to the person who posts questions, even though there might be few upvoted answers. These generally get pushed back quickly given the frequency of new questions. This would cause the question to escape the view of the right person capable of answering it.  Some people would be motivated to answer unanswered questions. Some might skip going through the question if they see enough number of votes on the already answered question. Or might not make past the first few pages of the unanswered questions.  Is there a proper way to bump up the question without breaking any rules?  From :     Edit your question to provide   status and progress updates. Document   your own continued efforts to answer   your question. This will naturally   bump your question and get more people interested in it.    What does the bump here mean? Does editing the question push it up the stack in the relevant tags? Make it move to the first pages?


I accidentally pulled a Shimano Deore brake lever with the rotor and pads off

As the title says, I didn't realize pulling the brake will get it stuck in a closed position when wheel and pads are removed. Now the reason I'm asking this  is none of the answers worked for me.  So what happened? Step by step description of the (rather long) process:   pads were worn off and started making funny noises, so I thought I'd remove them (first mistake) pulled the brake lever without any pads (second mistake) used the bike like this for a while I bought new pads, then removed the (back) wheel observed brakes stuck in a closed position, then I stupidly pulled the lever again (!)   I tried separating them with a wide range of tools, just they keep coming back in after a few seconds. Right after I stick something in between, push them apart from each other, if I wait a few seconds they are right back in the previous (wrong) position.  I'd like to know if there's anything I can do now, without bleeding the brake or anything I don't think I'm prepared for with my rather primitive tools.  Thank you all in advance for the answers, happy holidays & ride safe and fun!  EDIT: I just noticed  and its answers. I will try to leave it overnight, then attempt a bleeding if it doesn't work (I'm aware of the trapped air possibility).  EDIT #2: I attempted to spread apart the pistons again, and succeeded, then I stuck a solid piece of wood that barely fit between them. Left it like this overnight + a few hours later, then removed the wooden piece and left it free for a while. It seems the pistons got back to their normal position and all I needed was a bit of patience.  Thanks to all the people who replied on the linked questions, they really saved me some experiments and possibly more. Cheers!


Exclude one user from login screen with 18.04 LTS

I tried two ways. First I edited gdm3/custom.conf  sudo gedit /etc/gdm3/custom.conf   in order to add up a greetere section where the user to be hiden should be listed like  [greeter] Exclude=nobody,anakin,r2d2   I restarted Ubuntu and still the use to be hidden was shown on login screen. I tried to locate the [greeter] section before or after the [daemon] section with no more luck.  Second, I tried to install gdm3setup et gdm3setup-utils in the directory  /home/moi/IT/GIT This install is checked ok :  git status Sur la branche master Votre branche est à jour avec 'origin/master'. rien à valider, la copie de travail est propre   I aded-up /home/moi/IT/GIT to the $PATH by   export PATH=$PATH:/home/me/IT/GIT/gdm3setup   But still I can't find gdm3setup either in the applications list or in the Activities drop down list.  Some help would be much appreciated.  EDIT : Thanks to PRATAP, I managed to get rid of the user to be hidden during login. At Danzel's attention : the git deposits are here :  git clone https://github.com/Nano77/gdm3setup-utils.git git clone https://github.com/Nano77/gdm3setup.git   However, as I succeeded in my intent, I will no longer try to install gdm3setup. Thank you for your worthy help.


Let $a_n$ and $b_n$ be two positive sequences such that $$ b_n =\frac{a_1 + a_2 + ... + a_n} {n}  $$ Prove that $\lim_{n\to \infty} a_n = 0$ implies $\lim_{n\to \infty} b_n = 0$. Is the converse true?


How can I find out what kind of file this is?

I have  file, and I have absolutely no idea what kind of file it is.  When I open it in Notepad++ it reads as  ð    X      döS      or    How can I figure out what this is, and how to modfiy it?


I’ve started boiling eggs again after a long time.  I’m simply adding the eggs, bringing to a hard boil then light boil for 10 minutes. I notice the outside of the egg yolk turns grey. The outside of the white part feels like there’s a film on it but and it’s not as soft as the inner white part.  Does this grey tint mean its overcooked and is it possible to boil eggs such that the egg yolk surface will always be yellow? Is it possible to get the surface of the white part as soft as the inner white part?  Thanks


How can I typeset my book in a 10.5pt font size using the  document class? I tried using  \fontsize{10.5}{12}\selectfont   but it doesn't seem to work.


Proving the inequality $|e^z-1|\leq e^{|z|}-1$

I am trying to prove this inequality  $$|e^z-1|\leq e^{|z|}-1\leq |z|e^{|z|}$$  I've tried calculating the difference in their power series   $$\sum_{k=0}^\infty\frac{|z|^k}{k!}-1-\left|\,\sum_{k=0}^\infty\frac{z^k}{k!}-1\,\right|$$   but did not get anywhere.


Determine the Value of $\sum_{n=0}^{\infty} (1+n)x^n$

For $x\in\mathbb{R}$ with $|x|<1$.  Find the value of      $$\sum_{n=0}^{\infty} (1+n)x^n$$


I have a big dataset with 30000 rows and 60 columns (variables).  I would like to implement factor analysis aiming to find factors between variables.  What kind of factor analysis and what measures I should check to find if the factors are fine?


I have given seven cipher text encryted by the many-time pad. All are encrypted uwith the same random chosen secret key but I have no idea how to decrypt them. There are 7 ciphertexts: 758c7313325a32e070d50a8fc9993a7822f54e88c7433f3ef29da27405eb1a 688a705c265e21f17fd51c8fd6933e6270f549d1860a3e7bffd0a27a19fb1af947 7196795426522de87fd4158fd69e32626ef81dc6c9176d39f39db67c0de912f446fe31 758c73133c5a33f179c81bcecb857d6476e959d1860b2428e2d2a06c 718c6f403d5033a57fc952d8cd97293772f444dbcf002428e2cef2661ffa1fee 758c7313245b39f67fd91bcecb857d6770fd5edccf00287bfbd8b67c08e615f2 758c7f40744332ea74d617c2859f2e376cf34988d20b2c2fb6d9bb730de618e25fe6


i am trying to sort a file that has 600 columns. i want it gives me highest number number in all on top (descending order for each field) i just slice the file which is space separated to see if it is working fine. i tried out these commands but  seems as if i am doing something wrong  $ cat test.txt +0.07273 +0.67860 -6.99580 -0.44278  -7.21295 +0.19793  $ sort -nr test.txt # (just sorted column one) -7.21295 +0.19793 -6.99580 -0.44278  +0.07273 +0.67860  $ sort -k1,1nr -k2,2nr test.txt # (just sorted column one) +0.0727  +0.67860 -6.99580 -0.44278  -7.21295 +0.19793   how can i sort entire columns in descending order. it will be hard to use k 600 times


Does plperlu reload Perl modules if they change?

If I wrote something in plperlu, and it used a Perl module (e.g. MyModule::Foo), when would that module be reloaded? Does it keep track of them like mod_perl's , so that a touch will cause a reinterpretation?


What is vtable anchoring, and how does it work in a shared object?

I was performing research into some issues with a C++ library and ensuring type information is consistent between the application and the shared object. I'm also interested in ensuring an EqualObject comparison works, meaning I indeed have the same object, and not two objects that happen to be equal under operator==.   state to anchor a vtable in a header. I'm not familiar with the technique. Or I've heard it called by another name.  What is vtable anchoring, and how does it work?    I'm also aware of  from the GCC FAQ.


A Fourier transform of a continuous $L^1$ function

I know that for every function $f\in L^1(R)$ its Fourier transform has the following properties: it is continuous, it's bounded, and we have the limit $$ \lim_{\omega\to\pm\infty} \hat f (\omega) = 0 $$ which is the Riemann-Lebesgue lemma. Now suppose the function $f$ also has these properties (and it is in $L_1$). Will its Fourier transform be also in L1? That is, if $$ f\in L^1(R),  \mbox{ f is continuous and  } \lim_{x\to\pm\infty}  f (x) = 0$$ does it mean that $$ \hat f(\omega)\in L^1(R)$$ or not? My first intuition is no, but I don't have a counter example.  Any ideas?


GUI behaves weirdly after adding new objects and resizing

I have a JPanel that has a button which when pressed is to create a new circle. However, that doesn't happen. A new circle doesn't appear and when I resize a window the existing circle breaks, the clone of the button appears on the other side of the panel and everything freezes.  class Panel extends JPanel  {      private JButton button;     private Ellipse2D.Double[] circles;     Integer count;      public Panel()  {             setup();     }      private void setup()  {             count=new Integer(0);             circles=new Ellipse2D.Double[10];             button=new JButton(count.toString());             button.addActionListener(new ActionListener() {                @Override                public void actionPerformed(ActionEvent e) {                            circles[count]=new                                Ellipse2D.Double(10, 10, 100, 100);                            count++;                            button.setText(count.toString());                     }                 });                 add(button);         }       public void paintComponent(Graphics g)  {             super.paintComponent(g);             paintStuff(g);         }      private void paintStuff(Graphics g)  {             Graphics2D g2=(Graphics2D) g;             g2.setPaint(Color.RED);             Ellipse2D.Double circle2=new Ellipse2D.Double(getWidth()/2-                     getHeight()/4,                     getHeight()/4, getHeight()/2, getHeight()/2);             g2.draw(circle2);              if (count!=0)  {                 for (Ellipse2D.Double circle: circles)  {                         g2.draw(circle);                 }             }     } }  public class Frame extends JFrame  {      private Panel panel;      public Frame()  {         panel=new Panel();         add(panel);      }       public static void main(String[] args)  {           Frame frame=new Frame();      } }   What is wrong and what should I do to fix it?


What are the UK tourist visa requirements for an Algerian citizen on an Irish work visa?

When an Algerian citizen in Ireland on an Irish work visa wishes to visit the UK, say by air, on holiday, must he apply for a UK visa?


I have a pneumatic solenoid valve switching from IRF830 MOSFET. Solenoid valve connected to MOSFET by 2-3 feet long wire.  It's necessary to use a freewheeling diode for this?  What is the most suitable place to mount the diode ? Either near the solenoid valve or near MOSFET?  P.S.  This question about most suitable place for diode. Not about diode is need or not.


I have a class , it passes objects,primitive . can anyone please explain this     public class TestObj { String name; int age;  public TestObj(String name, int age) {     this.name = name;     this.age = age; }  public String getName() {     return name; }  public void setName(String name) {     this.name = name; }  public int getAge() {     return age; }  public void setAge(int age) {     this.age = age; }  @Override public String toString() {     return "TestObj{" + "name=" + name + ", age=" + age + '}'; }  }   main class    public class Test {  public static void main(String[] args) {     Test t = new Test();      TestObj obj = new TestObj("James", 25);     System.out.println("************* Output ****************");     System.out.println(obj);     t.setName(obj);     t.setAge(obj);     System.out.println(obj);      String a = "Hai Test";     System.out.println(">> :: " + a);     t.setString(a);     System.out.println(":: " + a);      int x = 10;     System.out.println("------- " + x);     t.setInt(x);     System.out.println("------- " + x);  }  public void setInt(int y) {     y = 25; }  public void setString(String x) {     x = "Did i changed my Data";  }  public void setName(TestObj obj1) {     obj1.setName("I got Changed"); }  public void setAge(TestObj obj1) {     obj1.setAge(35); }  }     ************* Output ****************            TestObj{name=James, age=25}            TestObj{name=I got Changed, age=35}            :: Hai Test            :: Hai Test            ------- 10            ------- 10


Should i use default.target or timers.target value for WantedBy for a systemd user timer?

My .timer file located in ~/.config/systemd/user doesn't show in output of systemctl --user list-timers --all command unless i enable it. Is it normal for this command to not show disabled .timers alongside enabled ones? I cannot enable the .timer without an [Install] section because of The unit files have no installation config error. According to freedesktop.org documentation:  Timer units will automatically have a dependency of type Before= on timers.target  Does this mean that i do not have to enable my .timer for it in order to work? If i do need to enable my .timer: I believe that default.target is what software which is to be executed after successful user login is WantedBy. I also believe that the user systemd instance is started by pam_systemd, which i believe happens before default.target. So it seems to me that if i use default.target the timer will be activated after login. If i use OnStartupSec in this case, will it correctly count the time from the startup of the systemd user instance? On the other hand, if i use timers.target, since this is a user timer, will it be activated before login and start counting the seconds from its activation time, or it will just register and start counting time only after systemd --user is started?


C program crash when I do a big memory allocation on the stack

This simple program crash when I compile and run it on Windows with Visual C++:  #include <stdio.h>  void foo() {     printf("function begin\n");     int n[1000000];     for(long int i = 0; i < 1000000; i++)     {         n[i] = 2;     }     printf("function end\n"); } int main() {     printf("hello\n");     foo();     printf("end of the program\n"); }   I compile with cl bug.c.  In this case, the console only displays:  C:\Users\senss\Desktop>bug hello   However, when I change the 1 000 000 value to 100 000, there is no problem :  C:\Users\senss\Desktop>bug hello function begin function end end of the program   Thank you!


If $a+ib$, $c+id$, $e+if$ are three complex numbers, than can we tell which one is greater or smaller between them? If yes, then how and if no then why not?   Can somebody give explanation on this.... I will be grateful to him.


How do I know my k-means clustering algorithm is suffering from the curse of dimensionality?

I believe that the title of this question says it all.


schengen visa application for the second one

I have a Schengen visa valid until the 8th of July and I want to apply for a visa from the 12th of July is that possible or would they refuse it?


Is \tkzDrawVector(s) from tkz-euclide working?

Is is just me or is \tkzDrawVector(s) from tkz-euclide package not working at all?  Interestingly enough \tkzDefVector works perfectly well. :)  For instance the example from p.155 of the manual:   \documentclass{article} \usepackage{tkz-euclide} \begin{document}  \begin{tikzpicture}[scale=.5] \tkzDefPoint(1,1){A} \tkzDefPoint(8,0){B} \tkzDefPoint(3,4){C} \tkzDefVector[colinear= at C](A,B){D} \tkzDrawVectors[color=blue](A,B A,C) \tkzDrawVector[color=red](A,D) \tkzLabelPoints(A,B,C,D) \end{tikzpicture} \end{document}   Causes:  ! Undefined control sequence. l.10 \tkzDrawVectors                     [color=blue](A,B A,C) ?


Number of ways to insert parentheses between elements

From Rosen's Discrete Mathematics and Its Applications, 3ed, chapter 8.1 p. 506-507:    ...there are Ck ways to insert parentheses in the product x0 · x1 · · · · · xk  I would like to ask where this conclusion comes from.  I am at a loss here.  It feels that this proof does not give me the whole story.  Thank you.


Unable to take kernel logs on a non-rooted device

I am trying to take kernel logs but so far have only got errors like 'permission denied', 'path does not exist' or 'kernel log does not exist'. I have tried , , ,, , and several other links. List of commands tried:  cat /proc/last_kmsg dmesg cat /proc/kmsg cat /dev/kmsg cat /sys/fs/pstore/console-ramoops *#9900# (Samsung only)  I am doing this in response to a comment on . Any suggestions? Edit: So I have been able to get logs using *#9900#. The kernel log option didn't work but I set debug mode to high, let the reboot happen and then used the inbuilt option to copy logs to storage. The device restarted and showed 'watchdog reset' after which I force restarted. Along with many other files, texts, logs, it has mention of /proc/last_kmsg in a txt file. I will see if it is useful and share in the original post.


Is it possible to decrypt cryptowall-encrypted files?

I am writing regarding a certain ransomware program called cryptowall (prop 4.0).  I have lost many documents to this, and as it so happens, I have a few file duplicates before and after they were forcefully encrypted.  My question is whether or not it is possible for someone knowledgeable to figure out the key used and decrypt these particular files by comparing the two copies? Thanks for taking the time to even read this; you can't imagine how important these documents are to me, pretty much 8 years of work.


Working with template suggestions on Drupal 8

I need Drupal to use a custom page template if the URL contains a particular _GET parameter.  In D7 I would do something like this in the theme's template.php:  function mytheme_preprocess_page(&$variables) {       if($_GET['isCustomTpl'] == true)         $variables['theme_hook_suggestions'][] =  'page__myCustomTpl'; }   It doesn't work in D8 though (I would have been surprised by the opposite, considering all the architectural changes in the theme layer).  Any ideas?  Bonus question: is it possible to define such a function in a module, so that i can release it publicly without having the users to edit their themes?


Sum of normal independent random variables with coefficients

I'm trying to wrap my head around linear transformations to random variables (with coefficients > 1).  Consider the two random and independent variables $X$ and $Y$ where:  $$X \sim \mathcal{N}(0,1)\qquad Y \sim \mathcal{N}(-1, 2)$$  I'm trying to determine the distribution of $Z = 2X + 3Y$.    The attempt so far:  I've defined the MGF of both $X$ and $Y$ as:  \begin{align*}M_X(s) &= \exp(s \mu + \sigma^2 s^2 / 2) = \exp(s^2/2)\\ M_Y(s) &= \exp(-s + s^2)\\ \end{align*}  Then the plan was to calculate $U$ as:  $Z = 2X + 3Y = 2 \exp(s^2/2) \cdot 3 \exp(-s + s^2) = 6 \exp(3s^2/2 - s)$  This lead me to a dead end and I'm not sure if this is the right approach, the "new" MGF doesn't exactly look like anything I know.  I've considered using a convolution to try and solve this but I am not 100% about that approach.   There was a mention on  about how to do it for the case of the coefficients = 1 and that there was a special case for coeffs > 1 (however it failed to expand on it).    I've done some simulations in MATLAB with random sampling from both of these Gaussians  and then applying the transformation. The results indicate the solution should be (assuming the code is correct):  $Z \sim \mathcal{N}(-3, 22)$


How to algebraically prove $\binom{n+m}{2} = nm + \binom{n}{2} + \binom{m}{2}$?

Need help trying to prove this problem algebraically.  $$\binom{n+m}{2} = nm + \binom{n}{2} + \binom{m}{2}$$  The farthest I've got is simplifying the RHS to $$nm + \frac{n(n-1)}{2!} + \frac{m(m-1)}{2!}$$ but not sure what to do after that.


How can I break on an unhandled exception in ASP.NET?

When debugging an application in Visual Studio, there are 2 options for breaking on exceptions. Break as soon as an exception is thrown, and breaking only when an exception isn't caught. This works fine when developing desktop applications. However, when developing ASP.NET applications, all exceptions are eventually caught by the code in IIS.  Is it possible to disable this behavior, so that the debugger breaks when my ASP.Net application code fails to catch an exception?  Edit: Just to be clear, I don't want to break whenever an exception is thrown, as many times they are handled just fine by my code, and I don't want to stop on every exception. I only want to stop on the exceptions that aren't handled by my code.  Edit: This seems to not be an issue in Visual Studio 2008. In Visual Studio 2003, all exceptions were treated as user handled, because the ASP.NET runtime caught all the exceptions so as not to bring down the web server process. It seems that in Visual Studio 2008, this type of exception catching is not counted when checking for user-unhandled exceptions.


How to loosen this strange nut of a cylinder lock?

I bought a new letterbox lock (Burgwächter ZBK-70, ), but the bar is too short. I'd like to exchange that bar, but I have no clue how to loosen the bolt. So far, I tried it with telecom pliers, but it didn't work. What is this black washer-like thing underneath the nut, by the way?


How to count the number of files in current directory that contain a specific phrase?

I want to count number of files in current directory that contain the phrase "HW".   I tried   ls -l | grep HW | wc -l


What do I do when my deep learning model in CNN does not learn?

I'm training on a skewed image dataset of 5000 images with class weights. The training loss decreases well and swift, but the validation-set loss fixates after around 6 epochs. I have tried using my custom model and also with transfer learning, with multiple hyperparameters. It follows the same structure everywhere. I am using categorical cross-entropy along with SGD with Nesterov momentum. This does not look like overfitting as the validation set stops performing just after 5 epochs(does not even fit).


Probability rule involving conditional and marginal distributions

The context of my question is Baysian generative models. The text book I am reading states  $p(\tilde{x} \, \vert \, D) = \int p(\tilde{x} \, \vert \, \theta) p(\theta \, \vert \, D) \, \mathrm{d}\theta$.  where $p(\tilde{x} \vert D)$ is the posterior predictive distribution ($\tilde{x}$ is a new data point, $D$ is the training data), and $p(\theta \vert D)$ is the posterior distribution ($\theta$ is the parameter of the model, $D$ as before is the training data).  This equation seems intuitively true, but I am having trouble proving it mathematically using the basic rules of conditional, marginal, etc. distributions.   Moreover, I think the general statement is not true. By which I mean, I think with random variables $X, Y, Z$, it is not the case that  $p(X \vert Z) = \int p(X \vert Y) p(Y \vert Z) \, \mathrm{d}Y$  What, then, is the relationship that must hold between $X, Y, Z$ such that the above statement is true? Is it that we must have $p(Y \vert Z) = p(Y)$?  In addition, if anyone can show me a proof of the first statement, it would be greatly appreciated.


How to get the angle to an object from angle you are facing

I am making an creature simulator where the creatures have a neural net for a brain.  One of the inputs to the net is the angle it has to travel to go to be facing the nearest piece of food. I can get the nearest piece of food, but I need a way of getting the angle it needs to travel to be facing the piece of food.   For example, if it was facing the food, it would be zero, and if it was facing away it would be 180. I got the creatures angle, if it is facing up it would be 0 degrees, and if its facing right its 90 degrees.


What would happen if I plug in two USB-C power supplies into the same Mac? Would it charge faster?

I have a bunch of USB-C power supplies (some at different wattages).  Would my Mac charge faster (or blow up) if I plug two power supplies into the same computer (different USB-C slots)


Problem with string: "undefined", unable to check this case

I'm getting coordinates via an API that works most of the time (giving me a String with a double, example : "53.2") but sometimes i see in the javascript console that I receive 'undefined' instead of let's say 53.2. I tried to check if what i receive is undefined but it doesn't work and I keep getting this type of error sometimes:     "java.lang.NumberFormatException: For input string: "undefined" "  Could you help me please? I'd like to know if I have to check with another condition, maybe null or something else..  EDIT: My main concern is more to know when i get undefined value in the Java servlet and less to make the Javascript work better. Thank you!      //JAVA CODE IN THE SERVLET     String fromlong = request.getParameter("fromlong");    //COORDINATES     String fromlat = request.getParameter("fromlat");     String tolong = request.getParameter("tolong");     String tolat = request.getParameter("tolat");      if(fromlat == "undefined") {         fromlat = "50.0";     }     if(fromlong == "undefined") {         fromlong = "50.0";     }     if(tolat == "undefined") {         tolat = "50.0";     }     if(fromlat == "undefined") {         tolong = "50.0";     }      //Then there is a function that uses these values   and that's the javascript code where i get the values with an api then send them with a hidden input (this works when the api sends me a correct value most of the time then i'd like to check if what i got in the servlet is correct before using it)  getCoordinates1(from);  function getCoordinates1(database){     $.ajax({         url: 'http://api.positionstack.com/v1/forward',         data: {           access_key: 'MYKEY',           query: database,           limit: 1         }       }).done(function(data) {             var mylatitude = data.data[0].latitude;             var mylongitude = data.data[0].longitude;              document.getElementById('fromlat').value = mylatitude;             document.getElementById('fromlong').value = mylongitude;              console.log(data.data[0].latitude);             console.log(data.data[0].longitude);       });     }          and at the end of the page i send this with an hidden input  <input type="hidden" id="fromlat" name="fromlat" value="" />


I have a nokia phone charger which has the following specifications:   Input: AC 100-240 V, 50-60 Hz, 100 mA    Output: DC 5.0 V, 350 mA   When I checked the output of the charger with a multimeter it shows 7.7 V. Why is it so? Is it because the charger voltage should be greater than battery voltage (for powering the load and charging battery) or any other reasons?


Does there exist a smooth bump function $\Phi: \mathbb{R} \rightarrow \mathbb{R} $ such that the sequence $M_k = \max_{x \in \mathbb{R}}|\Phi^{(k)}(x)|$ does not grow faster than exponentially? In general, are there examples of $\Phi$ where the $M_k$ grow (much) slower than in the case of $e^{\frac{1}{x^2-1}}$ (or the like)?    By smooth bump function, I mean a $C^\infty$ function that is $1$ in a neighbourhood of $0$ with compact support.  Pointers to other resources on this are appreciated as well.


How to find what thing make a cycle in systemd

when boot with systemd, my system display this message:  systemd[1]: Found ordering cycle on basic.target/start systemd[1]: Walked on cycle path to sysinit.target/start systemd[1]: Walked on cycle path to local-fs.target/start systemd[1]: Walked on cycle path to udevd.service/start systemd[1]: Walked on cycle path to basic.target/start systemd[1]: Breaking ordering cycle by deleting job local-fs.target/start   I cannot find any solution for this  Any suggestions please


How do I get the distinct/unique values in a column in Excel?

If I have a column with values, and I want to find out what distinct values are in there (not how many - but the actual distinct values), how can I do that?  In SQL Server I would do something like   SELECT Distinct(MyColumn) FROM MyTable


Replacing strings on a line in a file replaces empty lines

I create a simple batch to replace a specific string in a file and dump the output to a new file:  set oldstring=SERVER_IP set newstring=10.10.10.1  setlocal enabledelayedexpansion for /f "tokens=*" %%i in (test.txt) do (      set str=%%i      set str=!str:%oldstring%=%newstring%!      echo !str!>>newfile  )   If I run it on a file containing caracter 'a' a line feed, then a white space and a line feed I get the wrong output.  a[lf]  [lf]   OUPUT:  a SERVER_IP=10.10.10.1   Why do I get this the string I'm trying to replace in the output whenever I have a line full of white spaces?  EDIT  Expected output  a


14.04 freezes on start and stalls on restart/power down

About 2 out of 3 times I power on my computer, Ubuntu 14.04 freezes when loading some stage of the login (lightDM) screen. I have to manually power off my computer.   Also, when I go to restart or shutdown my computer from the menu, it just stalls on the Ubuntu screen with the four orange to white dots underneath it for all of time, or on a black screen, and I have to manually power off my computer. I thought perhaps this was an issue with the upgrade I did from 13.10 to 14.04 so I re-installed 14.04 over again from a bootable USB. Problem still persists. I am very new to Ubuntu, and don't really know what I'm doing/looking for with any kind of bug fixes, so any help is greatly appreciated!


I have a new 2019 MacBook Pro 16" on Catalina 10.15.5. I recently got it back from the shop - upper case replacement for bad keyboard that included replacing the battery as part of the repair. Now occasionally when plugged in the battery charge actually decreases. For instance last night I opened it, it was plugged in at 100%. I used it to make an email and print a few pages for 15 minutes and the charge actually decreased to 93%. The icon shows when plugged in. What would cause this? Ideas? Does anyone else have a MBP that decreases the battery charge while plugged?


Using have or has and was or were correctly in the given sentences (singular/plural)

What is the correct form (singular or plural) of the following two sentences:  A particular amount of students has/have access. A particular amount of students was/were selected.  In my opinion, it could be either referred to "amount", which would be singular (has/was) or to "students", which would be plural (have/were).


SEO - link closer to TLD vs. folder structure with keyword

Let's say I want to build just another voucher code website (don't worry, I don't) and also I'd like to categorize my listed shops. What would be the best URL structure?  My ideas are as follows:  Idea 1:     www.example.com/voucher - overview of all shops with codes (with   pagination)       www.example.com/voucher/shoes-c1 - filtering by category,   ID 1 (c1)       www.example.com/voucher/amazon-s1 - the important   landing page, ID 1 (s1)   So maybe you have seen that I would use s or c to determine weather it's a shop or a category.  Idea 2:     www.example.com/voucher      www.example.com/voucher/cat/shoes-1      www.example.com/voucher/amazon-1   Idea 3:     www.example.com/voucher      www.example.com/voucher/shoes-1      www.example.com/amazon-1   This looks clean to me but I would lose the "voucher" keyword at the most important landing page.  Idea 4:     www.example.com/voucher      www.example.com/voucher/shoes-1      www.example.com/amazon-voucher-1   I've read very much on the internet about this topic and there are so many different opinions. Some people say that a keyword is important. And some other will tell you that the important pages should be as close as possible to the TLD.  So what's the right way?


How can one disable automatic re-adding of an unwanted keyboard layout in Windows 10?

Canonical question: One has a Windows 10 installed with display language A, but uses keyboard layout B. What does one need to do, to stop Windows from automatically adding an unwanted keyboard layout from language A to one's system?  My example: I have a Windows 10 in English and I'm using a Slovenian keyboard layout. And this is working just fine, until I run a certain program that Windows ever so intelligently thinks needs an US keyboard layout. Windows adds this unwanted layout automatically, switches to it and doesn't remove it afterwards. The new layout isn't even listed in installed layouts. The only way to remove it after it appears, is to manually add it as a keyboard layout and remove it.  It seems that's a common problem for many people but after many hours of googling, I just couldn't find a good solution for it... It would be perfectly fine with me if I could just completely remove the US keyboard layout from my system, but if I do that, the keyboard stops working in some programs altogether.  Programs that I or other people have this problem with: ICQ, some versions of Microsoft Office (lol), games based on Source engine, some versions of UltraVNC, Adobe CC Suite, and the list goes on.


Questions repeating on consecutive pages

The scenario is like this: I click the Questions button and select the "newest" tab to see the latest questions. I have set it to show 50 questions per page. On reaching the end of the page, I click next. On the next page, I notice that some of the questions that I had seen earlier are again listed repeatedly. Say when I go to the fourth page, some of the questions I saw in the third page are seen. Is this expected behavior? I am using the  browser.


Not too well up on LaTeX, but I want to use the listings package for listings spanning a two-column format.  Unfortunately, asterisks cannot save me (like for figures/tables); this doesn't work:  \begin{lstlisting*} ... \end{lstlisting*}   I've Googled about, but got no satisfactory answer, and getting a bit desperate. Should be simple... hope I'm not missing something stupid. Perhaps it's possible to embed this into a separate spanning float?  Help?  (P.S., I've posted this on the main stackoverflow site as well...  if this is considered a duplicate, please comment and I'll remove the other. Getting a bit desperate fighting a deadline.)


Question-like structure (word order) in non-question sentences

Occasionally I see constructs like this in English sentences:        Not only is this true in this case, but ...      What puzzles me is the "is this" part of it. The sentence is not a question, yet it seems to have a question-like order. Isn't this correct/preferred:        Not only this is true in this case, but ...      Are there other cases where non-question sentences contain question-like parts (so to speak)?


Add "editing in progress" to questions/answers

This process has happened to me several times:   Read question (miss important detail) Answer (incorrectly, thanks to missed detail) Click "answer", page refreshes.  See other answers, realize mistake. Edit question to include detail. By the time I finished editing, I've received enough downvotes (usually without explanatory comments) to kill the question.   I've since learned to scrutinize questions better but I'm still human and make mistakes. I think it would be a good idea to add an Editing In Progress by:$username banner (like the ones that announce An Edit has been made to this post though perhaps a different color to avoid confusion).  A banner would allow others who notice an error in the question/answer to see that it's being fixed. This would prevent downvotes from users who would down vote technically incorrect questions, and unlike , my idea would also allow the owner to see when others are editing.


Why are the singular values of a matrix (from SVD) called so?

I have a pretty straightforward question and one which is related.  Main question:  Why are the singular values of a matrix (from SVD) called so ?   Related question:  Are they related to singularity of a matrix?


Is past simple ever justified with 'by'?

Can anyone shed some light on the following aspect?  By 5 PM I gave him the book.  By 5 PM I had given him the book.  In both the sentences the book was given before 5 PM and no later than 5 PM. But I can't understand then what the difference between them is. a Also is it right to use simple past with 'by' at all? If yes, then why and if not, then why is it incorrect to use simple past with 'by'?


Lets say p = str and  h = SHA512(p) i send the h which is the SHA512 of p to a friend using via email my friend in order to be sure that I'm the right person ask me to prove that I know the p. How can I can prove that I know p without disclosing it ?? As I have read so far its possible via zero-knowledge proof. Any pseudocode or python example are welcome.


Why does frictional force cause a car to move? Also, is friction a reaction force?

My teacher told me that this was because frictional force resists relative motion between the engine and the car. However, in this case it seems to allow relative motion between the ground and the car.


Is there a way to grant SELECT for every database (including new ones) at a server level?

I have a unique (well, I think it is unique) situation where databases (yes, entire databases) can be created more or less dynamically.  Ignoring the obvious issue with that, I need to be able to allow an AD account to read any of the data in any of the databases.  Acknowledging the security issue surrounding all of this, is there a way to grant this just once at the server level, rather than having to grant constantly when a new database pops up?  I would prefer to just keep it at a datareader level.  Specifically:  1. databases are created dynamically without advance knowledge of the DBA 2. Reporting jobs iterate through these databases and fail if they encounter a new one.  I am using SQL Server 2008R2 and SQL Server 2014.


Why am i getting numbers like (5.0306980803327406e-17) after simple calculations like subtraction?

money = 0.56; money -= 0.50; // here the result is 0.06000000000000005 when actually i need it to be just 0.06 money -= 0.06  // and after this subtraction the result becomes 5.0306980803327406e-17 console.log(money); // 5.0306980803327406e-17   This totally messes up my logic when for example I compare "money" with the number 0.


I am wondering how to summon the Golem boss in Terraria on PC. I have defeated Plantera.  How do I summon the Golem boss?


I'm trying to get my crontab to run a few rake tasks for a rails app, but it seems to always exit with the status of 127, in my syslog it look like this:  Jun  7 05:10:01 ip-10-170-122-226 CRON[15664]: (deploy) CMD (cd /home/deploy/apps/dashboard/current && bundle exec rake some:task Jun  7 05:10:01 ip-10-170-122-226 CRON[15662]: (CRON) error (grandchild #15664 failed with exit status 127)   It seems that 127 is like "command not found error" or something, so I've used the full paths to the bins even so like bundle was /usr/local/bin/bundle, The task runs fine outside of cron just running it in shell.  My crontab is simplily just:  */10 * * * * cd /home/deploy/apps/dashboard/current && bundle exec rake some:task   Does maybe my crontab need #!/usr/bin or something at the top?    update  To just test it, it does seem to run this just fine:  */1 * * * *  /usr/bin/touch /home/deploy/cron-test.txt   So that leads me to think its like a PATH varible thing, but I don't know how to get the right path vars in there, any thoughts?


The orientation of the interferometer arms at both sites are approximately Northeast-Southwest and Nortwest-Southeast, though I assume that, on account of the Earth's curvature, no pair of arms is exactly parallel. Is there a preferred orientation for the instruments, and is there a benefit in having them in (approximately) the same orientation? My guess on the latter issue is that if an interferometer has blind spots, it is better for those at both sites to be aligned (or at least overlap as much as possible), as a blind spot for one is a blind spot for the instrument as a whole.


javascript Object.prototype VS Anything.prototype

I'm confused with javascript's Object.prototype and Anything.prototype.  In chrome console, i have code below:    My questions:   The default prototype for any function is an instance of Object. Is it right? If 1 is true. So, both Anything.prototype and Object.prototype are an instance of Object. Object.prototype is an instance with its __proto__ === null. Therefore, Object.prototype is a special instance at the top of prototype chain. Can i understand like this?


I am using Illustrator. I got this:    and I want to create this effect:    At the moment I am using a white border to create this effect but I want to remove the part from the outer lines. I know that this is possible but how?


What is the language that appears on the first line of a script?

Bash scripts start with the following line  #!/bin/bash # Rest of script below ...   In bash the # character is the start of a comment, but #!/bin/bash is definitely not a comment, therefore  that interprets that statement.  So what exactly is that first line? Is it a specific language, or a special one-off case in the Linux kernel? Are there other commands or statements in this "language" that can be used when scripting?


Post your answer blocked due to closed question

Recently I was writing a quite large answer on Stack Overflow. When I finished I found out that the  "Post your answer" button was blocked because the question got closed.  I understand the fact that there is no case to answer a closed or bad question. But, what if I think I got the answer for that person?  Why can't we leave an answer (not visible) on that question, in case it gets reopened again?


What is the link (discrepancy?) between these PDF/CDF and p-value distributions?

I have created a mixed distribution model comprising 80% $H_0$ plus 20% $H_1$ to illustrate the link between the expected proportions of true and false positives and negatives in the PDF, CDF and p-value distributions.  When the effect size is small (25% increase in expected correlations vs $H_0$), everything looks consistent:    However, when I increase the effect size to 75% by separating $H_1$ from $H_0$, things don't seem to add up because I get apparent false negatives (grey area) in the p-value distribution, which are no longer there in the PDF and CDF distributions:    Conversely, when I reduce the effect size to 0% (so that $H_1$ = $H_0$), the grey area disappears altogether from the p-value distribution, whereas it is even more prominent in the PDF and CDF distributions:    Now, I'm sure I have done all the maths right and the actual distribution curves are correct and consistent, but perhaps I am misinterpreting the areas between these curves?  What do these four different coloured areas mean in each chart, and how do they relate to the expected proportions of true and false positives and negatives?  How can I show the link between these proportions in the three distributions, and why don't they correspond with each other as shown?  Please help me understand the apparent discrepancy, thanks!


Is the reputation system still valid on Meta?

I see people asking similar questions since the beginning of Stack Exchange, for different reasons.  What I think, especially after the latest events, seeing up and downvotes as a way to agree or disagree with someone anonymously: it made sense at the beginning, when it was about technical questions, but MSE is more like a social network, with lots of issues being discussed, and a lot of people pouring their emotion into their posts. Some can feel endorsed by a high number of upvotes, and think they are winning an argument because of the sheer number of supporters. That's not how a civil discussion should work, IMHO. I think this hampers inclusion, because users whose opinions are different from the majority don't feel welcome to participate.  It's not about "useful" vs "not useful", and I am not suggesting to remove the possibility of upvoting or downvoting. What bothers me today is that every question and answer has a big number of "likes", and that's the first thing I see. The signature on each answer has a name, a number of medals and a score. It's ok when you share some information and get feedback, not if you try to contribute your point of view on a particular subject.  This kind of gamification works well for technical Q&A sites (mostly), but I don't find it appropriate for general discussions like here in MSE. It keeps people from posting their opinion and risk becoming a downvote magnet, because upvoting someone else is cheaper.


ITIN received but original passport not received after 100 days. What to do?

Me and my daughter are dependents who got our ITIN in April, but did not get our passports back after 100 days.  We called the call center and got different answers at all times and twice they said it has been sent. Yesterday the customer care lady told me to ask the congressman of my place. Its been only 1 year since we came from India. My daughter is two.  We went to Bellevue IRS office but they did not help. We called taxpayer advocate but they said they don't take document missing cases. Now who is congressman of Bellevue Washington? Can he really get passports back? We can't get help from our embassy since the office is a 10 hour drive, and I don't think I have any original documents for myself and daughter. Hope to see reply. Worried to even call customer care since July.


Accessibility options mangled keyboard input

Someone messed up the accessibility settings on our Windows 10 PC and now when I log in the keys 7,8,9,0,j,k,l etc. are not working. After playing around with some Ease of Access settings the number keys started working but when I pressed k it would print 2, with L it would print 3 and so on. It works like this for some time but if I restart the PC it goes back to all those keys not working.  This only happens for 1 of the profiles on the PC. If you log in as a different user, the laptop's keyboard works normally.  The other surprising thing is that if I connect an external keyboard, then it works correctly for all user profiles.  How can I fix this?


Verification: prove $s=\sum_{n=2}^\infty\frac{1}{n(\ln n)^2}$ is convergent

$$s=\sum_{n=2}^\infty \frac{1}{n (\ln n)^2}.$$   So I use the integral test and when I do so the integrand is $$\int\frac{1}{x\;(\ln x)^2}dx =\frac{-1}{\ln x}$$ which converges to $\dfrac{1}{\ln2}$ therefore the series is also convergent.  And I need to find an integer such that $$\left\lvert s-\sum_{n=2}^\infty \frac{1}{n\;(\ln n)^2}\right\rvert < 10^{-3}.$$  How do I set this up? Is taking the integral of a series the same as summing it?


Simple light bulb operated by button and optoisolator triac

I'm new to the world of electronics and I have a quite simple question.  Can I control my light bulb with something like this schema?    Power source is regular AC 230V (~320Vrms) source.   Here is .  I want to control this using Arduino but is the underlying principle OK or not?  EDIT:  Modification with respect to Spehro's comments:   But now I do not know how to connect the TRIAC :)  EDIT:  Would this circuit be OK?   Now the optocoupler is switching the triac.


How can I check battery percentage in Razer Mamba Wireless 2018 in command line?

I have recently bought the Razer Mamba Wireless (2018) mouse. I would like to check the battery status (percentage) of the mouse in command line ?  Is is possible and how can I do this?  $ lsusb  Bus 001 Device 005: ID 1532:0072 Razer USA, Ltd    $ xinput  ⎡ Virtual core pointer                      id=2    [master pointer  (3)] ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)] ⎜   ↳ Razer Razer Mamba Wireless Receiver       id=13   [slave  pointer  (2)] ⎜   ↳ Razer Razer Mamba Wireless Receiver Consumer Control  id=17   [slave  pointer  (2)] ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]     ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]         ↳ Razer Razer Mamba Wireless Receiver Keyboard  id=14   [slave  keyboard (3)]     ↳ Razer Razer Mamba Wireless Receiver       id=15   [slave  keyboard (3)]     ↳ Razer Razer Mamba Wireless Receiver System Control    id=16   [slave  keyboard (3)]     ↳ Razer Razer Mamba Wireless Receiver Consumer Control  id=19   [slave  keyboard (3)]


Why is notepad++ writing to my new document?

I updated notepad++ and it started writing to the screen.  I quickly closed it not knowing what it was, but now I'm curious do I have a 'hacked' copy of notepad++?


How to replace multiple items with same count of a different item?

I am trying to make a custom food recipe. I'm using spawn eggs with /replaceitem because spawn eggs are not obtainable in survival. This works fine when the player crafts only one spawn egg, but when I scroll over multiple spawn eggs, I receive only 1 of the custom food. BTW this food uses custommodeldata, so I can't simply add it into the crafting recipe. I cannot seem to find a way around this. If I make the item non-stackable, such as a piece of armor, mass crafting would be impossible. If I make an item.dropped scoreboard, the player could keep the item and use it to spawn mobs (griefing or for own profit.)  My command:    execute as @a[nbt={SelectedItem:{id:"minecraft:villager_spawn_egg"}}] run replaceitem entity @s weapon  minecraft:melon_slice{CustomModelData:10000101,display:{ Name:"{\"text\":\"Blue Melon Slice\",\"italic\":\"false\"}"}}     My problem is that the command does not see item count, as it is often used for weapons and armor only.    One way I thought to fix this issue is by storing the amount of custom food crafted in a scoreboard item and then giving the player that same count of the custom food, but I do not know how to do this; consequently, I don't know if this works.    Is there a way to do this method, or is there another, simpler method possible?


Capacitance of bodies with different charge

How does one calculate the capacitance of two bodies with different charges? I was looking at coefficients of potential, but they don't seem helpful.


I tried to login to the minecraft.net site to check something, using my email address but it said : Invalid Password/Username. So i tried the same on the Mojang site but it still said : Invalid Password/Username.   I reset the password then, that was successful, but when i tried to login with my new password, it still said the same. Please help!


Is there a word for this kind of figure of speech

Is there any specific name for this type of question or statement?   If I ask someone a yes/no type question  "Have you lost your mind?"   then either answer(yes or no) is degrading to the person replying.  No - ok you never had it.  Yes - could mean he has gone crazy.  There could also be a statement made to a person, which if that person refutes he is shown in bad light or even if he agrees, it is bad for him. Is there any name for such device?   Any examples of such devices(questions or statements) where I could read more of this type.


Prerequisites to develop iphone native application

My company is planning to develop iphone-native-applications.  I'm good with Linux.  The questions are:  Do we need a MAC machine to develop iphone-app?  Can a normal development-framework like NETBEANS / ECLIPSE suffice?  What are the other pre-requisites that i might need?  Any help is very much appreciated.  Plz, pardon with me being totally naive with this IPHONE :-)  Thanks


How do I go about installing Ubunbu 13.10?  I have downloaded the distribution already, after acquiring an ebay computer with Ubuntu 13.04 pre-installed. Please can anyone instruct me?


Merry Christmas and Happy New Year are proper nouns. But, why are they used with an indefinite article as in "I wish you a Happy New Year/Merry Christmas.


$f: \mathbb{R} \to \mathbb{R}$ is continuous with $f(x)=0$ for all $x \in \mathbb{Q}$. Show that $f(x) = 0$ for all $x \in \mathbb{R}$.   Can anyone please point me in the right direction as to how I can go about answering this question?