Suppose everyone expects Apple to increase its earnings by 20% next year. Due to the general expectation, the current stock price will incorporate this information. For example, if subsequently Apple reports earnings that vindicates everyone's expectations, Apple's stock price will change by approximately $0, ceteris paribus. From my understanding, if everyone has the same expectations of an investment, the NPV of the investment is $0, because the expectations will be priced-in in such a way that makes the NPV = $0. I've been looking at index funds (e.g. S&P 500 ETFs). These funds seem to be commonly recommended for people with long investment horizons who want a passive diversified exposure to stocks. It appears that index funds are generally recommended on the basis that they "tend to increase in value over the long-run". From my observations, this "passive index fund investing" style has a very large following, especially in the US. For the moment, let us ignore the potential objections to the belief that index funds "tend to increase in value over the long-run", and let us assume that index funds are really going to increase in value in the future. Issues:  If the value of index funds is generally expected to increase, and people now continue to pump money into index funds in the belief that the values will materialize, wouldn't the future returns be approximately $0, as in the case of Apple illustrated above?  What prevents the future expectations of index fund performance from being priced-in at this very moment, thus ensuring that future returns will be mediocre?

It seems a common canon, that when you get to know information about the future of something at the stock market, that the price at the stock market already has this information calculated in. For example if it is expected that the next quarter a company will sell less and therefore be worth less, the price has already gone down, and if good sales for the next quarter are expected the price has already gone up because professional traders react faster (because of having more time to follow the news of the companies and better news sources, better analyzing tools, ...). Also for example for bonds the price per coupon seems to be original price + remaining dividends - likelihood/risk of non-payment for example because of bankruptcy. Simplified there is 50% chance expected that the value after the quarter announcement is $90 and a 50% chance the value after the announcement is $110, so the value before is $100. So you buy it at $100 and hope you are lucky and it will be worth $110. If you are unlucky you lost $10 per share. On average it will be $100. So to me it seems that for a non-professional it is just a gamble with an average 0 payout (before fees). Still many people seem to use it, for example for increasing money or in the USA for pension because of the missing pension system in the USA. Are those just speculators or what am I missing in my conclusions/where am I wrong/how does the non-professional person beat the predictions of the professionals? (I hope I didn't hurt anyone by the use of some terms because English is not my native language and I am not that familiar in this area) To clarify: I am asking for investing/holding a position for longer terms like at least multiple months/years, not day-trading. Even if a non-professional doesn't compete with professionals/doesn't want beat them they influence it so they can only buy it at a price that already includes expected future gains if I understand it correctly. But still people seem to make money with it. This is what I don't get. Please keep in mind that I am a beginner and have a beginner flaw in my thinking or not familiar with all effects/consequences in the market.


I do not want to start the openssh server on startup, but just by command if I need to.  By default, openssh always starts with booting, I removed in file /etc/init/ssh.conf the following line:  start on runlevel [2345]   but it still starts every time with booting. What do I need to do? Of course, I could setup a startup script to shut it off, but it would be much better simply disable starting it..

I read about how to enable and disable services in Ubuntu and it seems that there are different possibilities to manage them.  The first method I found is update-rc.d to add new services to startup, which aims on the /etc/init.d folder and its contents.  The other one I found is to edit .conf files in the /etc/init folder.  What's the recommended way to enable / disable / add services and why?  Could you please give a short bulletproof step by step example on how to add a service in Ubuntu and enable and disable it?


I graduated in 2016 with a 2:2, which I feel was lower than what I could have achieved.  I had had some minor issues before starting university, however I had an amazing support system and managed to get these in check. I completed my first year with only the normal issues (homesickness at first and adjusting to living away from home) until just before the end. I failed the last two exams of the year, partly due to the same issues that reoccurred later.   I had been struggling with one of my elective modules and after talking with my tutor, he recommended not worrying about it as I could fail 20 credits and as a 10 credit module, it would not affect my grade. However, the day of I woke up and completely panicked, zoning in and out all morning. I walked to the exam, and blanked and ended up in my department building instead of the exam hall, which was 20 minutes away and I had to run down a very steep hill to make it to the exam. But I made it and sat the exam.  I injured my knee while running. The problem with this is that my main coping method is exercise and I was on crutches. I then managed to completely space out for the last exam of the year. Meaning I failed both these modules, which was my 20 credit allowance. Despite this I averaged a high 2:1 for the year.  I went into my second year, with added roles and responsibilities. I had lived in catered accommodation in first year and moved to self catered in my second year. I became the social secretary of the physics society and started another sport (total of three) I had been a super human in my first year and wanted to do more. This turned out to be a bad idea, as my mental health started to decline, and my grades took a hit.  I then tried to pull them back up in my third year, but poor living conditions caused a physical health decline, which then exacerbated the mental health problems to a point where some days I couldn't get out of bed.  The main problem being that in my third year I was living with some really shitty people and they were really scathing of mental health issues, meaning I didn't seek the help I needed and am now getting and didn't apply for special circumstance. Hindsight really is 20:20.  I have taken time out of my career to get this sorted and to make sure that I am taking the right path for me. I have now ruled it down to three possible paths and want to apply to see what I can do.   I just want to know whether I should mention these issues and the steps I've taken in my time off to overcome these, on my personal statement. I don't seem to get anywhere else to put this and none of my previous lecturers know about this to mention on any references.

This question is inspired by answers and comments to the question  on this website.  Suppose that an applicant to a graduate program suffered from some mental health issues during the completion of his previous degrees, and that this situation had a noticeable impact on his academic performance (for example, significantly lower grades or part-time status for one or several semesters).  Most graduate school applications have sections dedicated to providing explanations for such special circumstances, and it is of course strongly recommended that any applicant with unusual drops in academic performance should mention something about this in the special circumstances section. Otherwise, the admission committee will be left to guess what might have happened, which is likely to decrease the odds of being admitted (indeed, it seems a consensus that the more tangible information an admission committee has about an applicant, the more confident they can be about the fact that admitting him will be a sound investment).  Many answers/comments to the question  seem to recommend being very careful about revealing details on one's mental health conditions, given that there is still a lot of stigma attached to mental health conditions. However, in the case of PhD applications, not mentioning anything is not an option.  This then leads to the following question: If not making any mention of health issues is not an option (such as in PhD applications), how much details should one go into? To avoid stereotyping associated to any particular disease (such as depression=unreliable, learning disability=not smart) one could limit the description to "health problem", but could this lack of details be seen as suspicious and/or still a situation where the admissions committee will have to do guesswork?


As the title says, when and what made Voldemort look the way he does (pale, snake-like etc) as opposed to how we've seen him in his earlier years as Tom Riddle? Is it just a side effect of his unnatural resurrection? Before he died attacking Harry as a baby did he look like a normal guy?

Recently I asked about the  pertaining to Voldemorts new face. However I was corrected by ...     Well, I think the confusion comes with mixing movie canon with book canon. In Philosopher's Stone, here's what Harry sees when Quirrell unwraps his turban:           Harry would have screamed, but he couldn’t make a sound. Where there should have been a back to Quirrell’s head, there was a face, the most terrible face Harry had ever seen. It was chalk white with glaring red eyes and slits for nostrils, like a snake.          Philosopher's Stone - page 212 - UK - chapter 17, The Man With Two Faces      So it seems at some point between leaving school, and sticking his face to the back of Quirrel's head possessing Quirrel he got a new face some how.   How did he manage that? Is it some dark magic he applies? Is it from possessing snakes in Albania?


I am preparing some reviews of conference contributions. The online review management asks me to grade the assigned papers, add comments for the authors and comments for the program chair. I cannot leave any field blank -- so I am wondering what comments I should give to the chair? To my knowledge, comments to the chair include suspected or actual cases of plagiarism.  Is there anything else, a chair might expect to read from me, the reviewer?  Should I give them a short version of my comments to the authors?   The conference homepage and the reviewer guidelines do not give any hints. Thank you for your input!

I've just been invited, for the first time, to review an article. The request was somewhat of a surprise to me, as I'm still a PhD student and I'd always thought that reviewers were generally PhD graduates. Judging by the article's abstract, I am moderately familiar with the subject area, as my master's thesis was on a similar topic. The article would appear in an online journal and would be relatively short (6-8 pages). I assume that my review would be anonymous.  I'm unsure whether to accept the invitation as I'm quite busy with my research.   If I agree to review the paper, what will be expected of me? How much time can I expect this to take?


We have a bunch of thin clients with Server 2012 CALs. These thin clients mostly run RDP to a Windows 2012 server  We want to put a SQL Server 2016 install on a Windows 2016 server. These are all separately licensed. Programs running on the 2012 server will then access the SQL Server 2016 database running on the Windows 2016 server.  We have been informed that this will cause a licensing issue with Microsoft and that each of the thin clients will need to also have Server 2016 CALs in order to keep Microsoft happy.  This seems plausible but unnecessarily greedy, even for Microsoft. Does anyone have any information that will clarify this issue?

This is a  about Licensing.    Questions on licensing are off-topic on Server Fault.  If your question has been closed as a duplicate of this question, then this is because we want to help you understand why licence questions are off topic rather than just telling you "it just is". In all likelihood, this question will not address your question directly, it was not meant to.    I have a question regarding software licensing. Can the Server Fault community please help with the following:   How many licenses do I need? Is this licensing configuration valid? What CALs do I need to be properly licensed? Can I run this product in a virtual environment? Can I downgrade this product to an earlier version? Am I entitled to feature X with license Y?


They only interact with gravity and weak force, so how do they emit their energy? My theory is that they would somehow emit photons (?)

Would it be theoretically possible for a high energy neutrino and another high energy anti-neutrino to annihilate into a boson?  Which boson(s) would be possible theoretically?     one or more photons?   the Higgs boson?   Z boson?


One of the ways I quickly rename files in Windows is   F2 > Rename > Tab (to next file) > Rename ...   But in Ubuntu/Nautilus, I can't tab to next file. But being on Linux, I think there must be a command line alternative.  However, sometimes, I may want more control over how to rename specific files. In that case, perhaps its better to be able to tab to the next file


How can I install Ubuntu on Samsung tablet or any android tablet.Please answer in detail. It would be appreciated if done by video or any easy method.

I would like to port Ubuntu Touch to a device that is currently not supported. What are the requirements for doing this and where do I begin?


I collect data into folders that each contain a number of pdf figures. What would be very useful is a latex code that could automatically import and arrange all figures in some standard way. This would save time in manually copying and pasting all filenames. The arrangement could be simple, e.g. place all figures vertically one beneath the other with some fixed scaling parameter.   Does latex or any extension of it provide such functionality?

I have several plots saved as .pdf in a folder and I would like to know if there is a way of adding all of them in a document at once, without typing the path to each file.


I am creating tables from a CSV file by using csvsimple package. The contents of the tables are all left aligned, hence I would like to know whether it is possible to center the first row alone (and the remaining rows being aligned to the left) ?  My code is:  \documentclass{beamer} \usepackage{csvsimple}  \begin{filecontents*}{\jobname.csv} 0.1,0.4,0.7,1.0,1.3 0.201,1.001,1.801,4.601,3.401 0.200,1.000,1.800,2.600,3.400 \end{filecontents*}  \begin{document}  \begin{frame}  \csvreader[autotabular, %full filter=\ifcsvstrcmp{\csvcoliv}{m}{\csvfilteraccept}{\csvfilterreject} ]{\jobname.csv}{}{\csvlinetotablerow}%  \end{frame}  \end{document}    shows how to switch the default alignment to center for the entire table, but can this be done only for the first row?

I'm using csvsimple for making tables, and csvautotabular and csvautobooktabular are working great. However, I'd like the content of each column to be centered instead of aligned to the left.   An answer using csvautotabular and/or csvautobooktabular simply adding an option would be preferred, if it's possible.   I tried this, but it returns an error.  \csvautotabular[tabular=c]{grade.csv}  \csvautobooktabular[tabular=c]{grade.csv}   Here's a MWE:  \documentclass[11pt,a4paper,oldfontcommands]{memoir}  \usepackage{csvsimple} % For csv importing.  % csv file from another question \begin{filecontents*}{grade.csv} name,givenname,matriculation,gender,grade Maier,Hans,12345,m,1.0 Huber,Anna,23456,f,2.3 Weisbaeck,Werner,34567,m,5.0 \end{filecontents*}  \begin{document} \csvautotabular{grade.csv} \end{document}   And the MWE output.     I want to obtain said output, but with the content of each column centered.    Note  csvautotabular gave me trouble trying to display special characters, but can be solved using the 'respect all' option.  e.g.  \csvautotabular[respect all]{table.csv}   Or with @egreg's custom command.   \csvautotabularcenter[respect all]{table.csv}


I can't find anyway to adjust brightness level of touch bar on my mbp 2017 with macOS High Sierra. Perhaps it can be changed by adjusting values in SMC? I have a different hardware model and macOS version so I asked another question. Please tell me if this is a duplicate question with .

Is there a way to adjust MacBook Pro's Touch Bar brightness?  MacBook Pro, 13", 2016, macOS Sierra 10.12.6


If $f$ and $g$ are continuous on $[a,b]$, $f(a)$ $\le$ $g(a)$, and $g(b)$ $\le$ $f(b)$, prove there is a point $c$ $\in [a,b]$ such that $f(c)$ $=$ $g(c)$.  Any ideas on how to solve?  I think I have to use the Intermediate Value Thm but I'm not sure.

Suppose $f$ and $g$ are continuous on $[a,b]$ and that $f(a) < g(a)$ but $f(b) > g(b)$.   Prove that $f(x) = g(x)$ for some $x \in [a,b]$.     I did try and actually did get as far as coming up with $f-g$. Would I set $h(x)= f(x)- g(x)$ and say $h(a) <x< h(b)$?


I'm looking for clarification about an aspect of this question:     is great except that I may not be the only one wondering where to put such functions()? Should it go in the youtube-dl config file created as per a previous answer? Or where elsewhere?

I am planning to create a function that would simplify things for me. The function  would be something like  function lazymode() { echo "Hello World!"; }   so that when I use the command lazymode in the shell , it will output the Hello World!.  What file should I put the user-defined function?


If you look at the edit history of a question (ie ), you can see if that question has been shared. However, if the question has not been edited then I don't see a way of finding out if it has been shared.   Is there an alternative way of seeing if a question has been shared?

Is there a link on a question's page to see the edit history of that question?  What is the "normal" way to get this information?


I was assigned to Prove that $\mathbb{Q}$ is countably infinite  I did the following:  We define $\mathbb{Q}= \lbrace \frac{a}{b} \mid a, b \in \mathbb{Z}_{>0} \rbrace$. Also define $\mathbb{Q} \xrightarrow{a} \mathbb{Z}_{>0} \times \mathbb{Z}_{>0}$ as $\forall a, b \in \mathbb{Z}_{>0}$ where $\frac{a}{b} \in \mathbb{Q}$, $q(\frac{a}{b})=(a,b)$. Then since $\mathbb{Z}_{>0}$ is countably infinite, and by the fact that the Cartesian product of two countably infinite sets is countably infinite, $\mathbb{Z}_{>0} \times \mathbb{Z}_{>0}$ is countably infinite with some mapping $\mathbb{Z}_{>0} \times \mathbb{Z}_{>0} \xrightarrow{b} \mathbb{Z}_{>0}$. Then the composite function $a \circ b$ is a bijection $\mathbb{Q} \xrightarrow{a \circ b} \mathbb{Z}_{>0}$ proving $\mathbb{Q}$ is countably infinite.   My question: is there any alternative way to prove this or is there any way to strengthen my proof or change it?

Can any one tell me how to prove that the set of rational numbers are countable? Prove give me a prove?  Thanks.


I want to know if there are any numerical bases that are notably well-suited for humans to learn and use at an elementary or grade-school level.  I know that different numerical bases (i.e. decimal/base-ten, senary/base-six, ternary/base-three, dozenal/base-twelve) have different patterns and quirks and tricks. Many historic cultures used bases other than decimal (some have even hung around to modern times, like how we divide days into 24 hours and hours into 60 minutes), and most of them did quite well for their time.  There is a similar question on this site, , but the question and its answers do not address my main question: ease of use for humans just starting to learn basic mathematics, while still remaining reasonably efficient for advanced mathematics.  Note: I'm not trying to suggest the world change to something other than the decimal system, or start teaching different bases to elementary schoolers. I'm just curious as to how other systems compare if we imagine parallel universes where each base has the same global presence, inertia, and educational/social infrastructure that is currently enjoyed by base-ten in our own universe.  Primary Considerations   Ease of mental arithmetic (addition, subtraction, multiplication, division)   In particular, prevalence of shortcuts/patterns that can be used to simplify mental calculation Multiplication tables are easy to learn, either because they're small or because they have intuitive patterns  Compactness, in two contradicting categories that need a compromise:   Numbers don't get long too quickly, to save time and space when writing Doesn't use too many symbols, to simplify learning Examples of poor compromising: Numbers stay really short in base-one-hundred-and-twenty, but it uses a ton of symbols. Base-two only uses two symbols, but numbers get really long really fast.    Bonus Points   The most common/basic fractions terminate (1/2, 1/3, 1/4) Interesting mathematical properties beyond simple arithmetic Many factors, like how dozenal divides evenly into halves, thirds, quarters, and sixths Simple conversion to/from binary, for binary computers Simple conversion to/from balanced ternary, for balance-scale math (or balanced ternary computers)   Note: Cross-posted to  as suggested by @JohnOmielan.   There are now answers on both sites. (So cross posting wasn't such a good idea after all.) (However, no answers on either site have fully answered the question as of yet.)

Most people use base 10; it's obviously the common notation in the modern world.  However, if we could change what became the common notation, would there be a better choice?  I'm aware that it very well may be that there is no intrinsically superior base, but for the purposes of humans, is there a better one?  I've heard from sources such as  and  that base 12 is better, from  that base 8 is better, and, being into computer science, I would say that base 16 is the most handy.  Base 12 does seem to be the most supported non-base 10 number system, mainly due to the following reason pointed out by George Dvorsky:     First and foremost, 12 is a highly composite number — the smallest   number with exactly four divisors: 2, 3, 4, and 6 (six if you count 1   and 12). As noted, 10 has only two. Consequently, 12 is much more   practical when using fractions — it's easier to divide units of   weights and measures into 12 parts, namely halves, thirds, and   quarters.   And, on top of that, previous societies considered very advanced used other systems, such as the Mayans using base 20, and the Babylonians using base 60.  So, summarized, my question is: Is there an intrinsically superior base? If not, is there one that would be best for society's purposes? Or does the best base depend on the context it is being used in?


I'm trying to write a function that takes in an arbritrary string and changes all the letters to the next letter in the alphabet (eg. "John" to "Kpio"). My function works if I define the string str (eg. char str[] = "John"), but not when I leave it as arbitrary; instead I get a segmentation fault (core dumped) error.   I've tried using pointers instead by adding *str to everything, but this didn't work and I'd rather the solution didn't use pointers since I'm still unfamiliar with them.   #include <stdio.h> /*declare function*/ void letter( char str[] ) { int i = 0; while ( str[ i ] != 0 ) {     str[i] += 1;     printf("%c", str[i]);     i++; } } /*call function with input "John"*/ int main( void ) {  letter( "John" ); return 0; }

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


I am planning a trip from San Diego, CA to Laredo, TX around December. The itinerary takes me from San Diego, CA to Tucson, AZ, then on to El Paso, TX on the first day; the next day it is straight from El Paso, TX to Laredo, TX. I will be traveling with my wife.  I have done this road trip several times before and I usually spend the night in a motel in El Paso, TX. I usually just sleep 8 hours, shower and check out right after. In my experience I do not get proper sleep because these motels are usually noisy at night because of their proximity to highways; loud tv-watching neighbors; or the casual group of noisy teenagers around.  Therefore I am not a huge fan of paying the $50 to $100 rate for the mediocre sleep that I usually get. So I was considering the possibility of sleeping inside my car (which does not bother me at all) and finding some place to shower the next morning.  Is it actually legal to park at some random place to sleep inside my car? Where would this be allowed? Are there any public places where one can take a shower (with or without paying a fee)?   Is my only choice to find a camping ground or RV park? Will this be cheaper (or worth it even)?   Noting that I usually cannot book anything more than 1 day in advance (I leave as soon as I get the chance), what would be my cheapest option?

I want to travel around the East Coast without paying for lodging.  I'd be willing to sleep in my car or even pitch a tent somewhere. Is this a problem?  Legal?  I really want to get to the beach this season but I’m afraid that lodging will be out of my price range.  Specifically Maryland, Delaware, maybe New Jersey or Virginia.


I'm attempting to prove that $$\sum_{k=0}^n(-1)^k{n \choose k}^2=\begin{cases}0&\text{if $n$ is odd}\\(-1)^m{2m \choose m}&\text{if $n$ = 2m}\end{cases}$$ via induction. Here's what I have so far: Base Case (odd): $n=1$ $$\sum_{k=0}^1(-1)^k{1 \choose k}^2=0$$ Base Case (even): $n=2$ $$\sum_{k=0}^2(-1)^k{2 \choose k}^2=-2$$ Hypothesis: $n=l$ $$\sum_{k=0}^l(-1)^k{l \choose k}^2=\begin{cases}0&\text{if $n$ is odd}\\(-1)^m{2m \choose m}&\text{if $n$ = 2m}\end{cases}$$ Inductive Step: $n=l+1$ $$\sum_{k=0}^{l+1}(-1)^k{l+1 \choose k}^2$$ I know that the goal is to get this sum into terms of the hypothesis plus the $(l+1)^{th}$ term, but I'm not sure how. I've tried manipulating various identities, but so far I'm not coming up with anything workable. Thanks in advance for any help.

find $$\sum_{k=0}^{t}(-1)^k\binom{t}{k}^2$$ for $t=2n$ then for $t=2n+1$  I tried by expand $(1-x)^n(1-x)^n$, with no result.  Any Help ?


I want to set a session value when running the main application. I tried the following way:  @SpringBootApplication public class WebApplication extends SpringBootServletInitializer {  @Autowired public HttpServletRequest request;  @Autowired private CountryService countryService;  private static Class<WebApplication> applicationClass = WebApplication.class;  @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {     return application.sources(applicationClass); }  public void set_session_country(){     request.getSession().setAttribute("session_countries", countryService.getAllCountry()); }  public static void main(String[] args) {     WebApplication webApplication = new WebApplication();     webApplication.set_session_country();     SpringApplication.run(WebApplication.class, args); }   }  when running application, occurred NullPointerException     Exception in thread "main" java.lang.NullPointerException       at com.paid.webapp.WebApplication.set_session_country       at com.paid.webapp.WebApplication.main

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I just started Java programming. I love it so far, but I have been stuck on this problem for a while.  When I run this code, whenever I type in “boy” it will just respond with GIRL:  import java.util.Scanner;  public class ifstatementgirlorboy {     public static void main(String args[]) {         System.out.println("Are you a boy or a girl?");         Scanner input = new Scanner(System.in);         String gender = input.nextLine();          if(gender=="boy") {              System.out.println("BOY");         }          else {              System.out.println("GIRL");          }     } }   Why?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


UK visit visa refusal I was recently denied a visit visa and I would like to re apply. The visa was denied because I had stated I had no income or savings, whilst I had also stated In the application I had a monthly expenditure of x amount. so that raiseD concerns on how I could spend that monthly without an income or savings. I do however get an allowance in cash from my mother Monthly but I didn’t in effect at the time realize I had to state that as an income. Also: my entire trip is being sponsored for by my spouse and father My in law (Accommodation,food etc..) and the Only cost I will bare is the purchase of a return air ticket, of which (as I also did on my last successful visa application) I was given funds by my mother for this and I went on and opened A bank account and My mother wired The funds into my personal bank account directly from hers. However my mothers bank statementS that I provided seemed to have missed the two pages that showed this money transfer/transaction  and so the statement couldn’t prove origin of funds. I have since collected my mother’s complete bank statement, and I will this time state in my application the allowance I get to correspond with my monthly expenditure. am open to all thoughts, ideas and recommendations. How best can I address these issues in my re application?

Many of the UK visa refusals we see here share a common pattern and the prevailing reasons refer to V 4.2 (a) and (c).    I do understand that, while the applicants may describe very different individual circumstances, there's a consistent pattern and, broadly, fall into specific categories:    Credibility (lifestyle, lack of ties, visit history, lies & omissions) Funding (insufficient funds, provenance of funds, funds parking) Sponsorship (family, friends, employer)   Question: What most commonly triggers a UK visa refusal where V 4.2 (a) and (c) are given as the grounds?  Secondarily: Given that there is a clear pattern, to what extent are these refusals predictable? Does sponsorship make a difference? Is there a set of personal circumstances, however abstract, where a refusal is all but guaranteed? For example, why do those we see here on TSE who sought entry for the PLAB or British Army appear to be refused with a common theme? Is there a uniform shortcoming or is it just discrimination?   PLAB: What is about applications for a visa, for the purpose of sitting the Professional and Linguistic Assessments Board (PLAB) exam, that seem to invite refusals. After all, the test is given so that international medical graduates can show that they qualify to practise medicine in the UK. The first part, PLAB 1, can be taken in centres outside of the UK. However, PLAB 2 can be taken only in the UK. Why can't you can't get a visa just to sit the exam, promising that you'll leave immediately after?    British Army: Since Commonwealth citizens are eligible to apply online to join, even those who don't reside in the UK, why is it so difficult to get a visa just to attend an interview to see whether you are suitable? Even with an invitation from the Army, such visa applications seem to be unsuccessful. Isn't a career in the British Army a valid reason?     Lastly:  After such a refusal, what approaches would increase the chance of a successful application?


I'm using MySQL's AUTO_INCREMENT field and InnoDB to support transactions. I noticed when I rollback the transaction, the AUTO_INCREMENT field is not rollbacked? But when I don't call RollBack the id doesn't change.  try {  //My Code } catch (MySqlException ex) {     //deadlock exception in mysql        if (ex.Number == 1213)     {         //I don't use RollBack and the id dosen't change         MessageBox.Show("Try again", "Warning");     }     else     {         msqlTr.Rollback();         txtError.Text = "Erreur : " + ex.Message;         Log.LogError.setError(ex);         MessageBox.Show("Erreur : " + ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);     } } catch (Exception ex) {     msqlTr.Rollback();     txtError.Text = "Erreur : " + ex.Message;     Log.LogError.setError(ex);     MessageBox.Show("Erreur : " + ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); }   If this code correct, I mean that when I don't call rollback?

I'm using MySQL's AUTO_INCREMENT field and InnoDB to support transactions. I noticed when I rollback the transaction, the AUTO_INCREMENT field is not rollbacked? I found out that it was designed this way but are there any workarounds to this?


In the current scenario, the images are arranged in a vertical sense, however I wanted to align the subfigures in a horizontal sense. This is the code that I'm using. Also I'm working on a template, which follows IEEE convention.  \begin{figure}[h] \begin{subfigure}[b]{0.25\textwidth} \includegraphics[width=0.7\linewidth,height=5cm]{MobileApp/login.png} \caption{Login Screen} \label{fig:login screen} \end{subfigure} \begin{subfigure}[b]{0.25\textwidth} \includegraphics[width=0.7\linewidth,height=5cm]{MobileApp/Selectcanteen.png} \caption{Select Canteen Screen} \label{fig:Select canteen screen} \end{subfigure}  \caption{Caption for this figure with two images} \label{fig:image2} \end{figure}

The three lengths \textwidth, \linewidth and \hsize seem to all hold the width of the current line. At least I never saw some real difference between \textwidth and \linewidth in my code. Both seem to be identical even when changed, e.g. by a minipage environment.  Could someone give me an elaborate explanation of the differences between these lengths? I like to understand them in detail. I know that the first two are from LaTeX and the latter one from plainTeX.  There is also \columnwidth which seems to be identical to \linewidth or \textwidth in one-column mode, right? Except when the line is reduced by a minipage or quote etc. environment.


Real Analysis Prove that 2/π ≤(sinx)/x ≤ 1 for all |x|≤ π/2 ? Just need the 2/π greater than part.

I need to show that $\dfrac{2}{\pi}<\dfrac{\sin(x)}{x}<1$ for $0<x<\dfrac{\pi}{2}$.  I know I need to use the mean value theorem, would I just say that since $f$ is continuous in the interval (call it I).  We know $\exists c\in I$ such that $f'(c) = \dfrac{f\left(\dfrac{\pi}{2}\right)-f(0)}{\dfrac{\pi}{2}}$. I don't know where this is going though.  Also, would I need to show $\lim_{x \to 0}\dfrac{\sin(x)}{x} = 1$? Is there a way to do this without L'H Rule?


I have a question of quantum mechanics. I want to calculate \begin{align}\left\langle \frac{1}{r} \right\rangle \end{align} in the state $n, l$ of the hydrogen atom. In the textbook I have, the wavefunction is given as \begin{align} \psi_{nlm} = \sqrt{\left(\frac{2Z}{na_0}\right)^3\frac{(n-l-1)!}{2n[(n+l)!]^3}} e^{-Zr/na_{0}}\left(\frac{Zr}{na_{0}}\right)^{l}L^{2l+1}_{n+l}\left(\frac{2Z}{na_{0}}r\right)Y^{m}_{l}(\theta, \phi)\end{align} Though I referred , the index of the associated Laguerre polynomial and the normalization coefficient are quite different hence I cannot get an idea how to simplify the result. How can I calculate the expectation of \begin{align}\left\langle \frac{1}{r}\right\rangle?\end{align}

I'm trying to derive $\left\langle \frac{1}{r} \right\rangle = \frac{1}{n^2 a_0}$ (where $a_0$ is the Bohr radius) for the $| nlm\rangle$ state of hydrogen.  I've separated the radial and angular parts of the hydrogen wavefunction and split up the integration to yield  \begin{align}\left\langle \frac{1}{r} \right\rangle &= \int R^*_{nl}(r) {Y^{m}_{l}}^*(\theta, \phi) \frac{1}{r} R_{nl}(r) Y_{l}^{m}(\theta, \phi) r^2 \sin \theta ~\mathrm dr ~\mathrm d\theta~\mathrm d\phi\\ &= \int {Y^{m}_{l}}^*(\theta, \phi) Y_{l}^{m}(\theta, \phi) \sin \theta ~\mathrm d\theta ~\mathrm d\phi \int \limits_{0}^{\infty} r R^*_{nl}(r) R_{nl}(r) ~\mathrm dr\\ &= \int \limits_{0}^{\infty} r R^*_{nl}(r) R_{nl}(r) ~\mathrm dr\end{align}  But from here, I'm not sure how to continue. Since $R_{nl}(r)$ is defined as $$R_{nl}(r) = \left( \frac{2 Z}{n a_0} r \right)^l \sum \limits_{k = 0}^{n - l - 1} a_k \left( \frac{2 Z}{n a_0} r \right)^k e^{-Zr/n a_0}$$ where $$a_{k + 1} = \frac{k + l + 1 - n}{(k + 1)(k + 2l + 2)}a_k$$  How do I deal with the sum inside the integral (especially a sum that requires recursion to compute coefficients)?  Have looked this  so far.


Several times I have seen this advice (or words to this effect): "Never use \\ to break lines outside special contexts such as tabular." (for example, ). I cannot find a source for this advice.   Indeed, "The LaTeX Companion" (page 104) has this:      "Other ways of typesetting paragraphs are flush right and centered, with the flushright and center environments, respectively. In these cases the line breaks are usually indicated with the \\ command, whereas for ragged-right text (the flushleft environment discussed above) you can let LaTeX do the line breaking itself (if you are happy with the resulting quality)."    Moreover, instances of the use of \\ to format paragraphs are legion. Why is this use of \\ ill-advised?

What is the difference between \par, \newline, \\ and blank lines? When should I use which one?


I have multiple elements with  different stroke colours. I would like to fill all the elements with  their individual outer stroke colours. Is there a way to do this without having to apply outer stroke colour to the fill individually for  each element?

I have auto traced a photograph in illustrator - its got thousands of vectors once I expand it and illustrator has converted each of them to a filled colour - I want to now trace the edges of them with a grungy brush but using the underlying fill colour. Where in illustrator can I stroke or outline these fills using the underlying colour - surely this is something that the program automatically does?   I've found this script online but don't know how to implement it. I'm new to this so any help appreciated. Many thanks.   James   var idoc = app.activeDocument;   var sel = idoc.selection;    for (i=0; i<sel.length; i++) {       var ipath = sel[i];       ipath.stroked = true;       ipath.strokeColor = ipath.fillColor;   }


15 h 11 m 59  s 48 h 11 m 59  s   I need to convert the above text to "48:11:59"(Time format) and apply the average function on that. Can any one help on that?

I've got an excerpt of my spreadsheet below. It's a time tracking application containing a start date/day, a session ID and the duration of the session. Column A is populated by adding the duration in Column D. I'm trying to total the durations, but keep getting incorrect values in cases where the total duration is > 24 hours.  Consider        A                   B        C                D          1  2012/05/22 01:00  |  Wed  |  Session 23341  |  9:00 2  2012/05/23 10:00  |  Wed  |  Session 23342  | 22:00 3  2012/05/25 08:00  |  Fri  |                 |  0:00   As you can see, the date differential between A2 and A3 demonstrates that the value of 22:00 in D2 represents a duration of 46 hours (05/23 10:00 + 46:00 = 05/25 08:00). However, Column D is only displaying the 22:00 in excess of a full 24 hour day.  My attempts to read D2 have included int(d2) = 0.00  /  int(d2)*24 = 0.00  /  hour(d2) = 22.00  /  int(a3-a2)*24 =0.00 etc. and have been unsuccessful in pulling a value of "46".   How can I accurately represent D2 to achieve accurate summary data?


The total number of ways in which 5 balls of $different$ colours can be distributed among 3 $persons$ so that each person gets at least one ball. This is a case of distinct to distinct. Case 1. groups of 1, 1, 3  gives ${5 \choose 1}$ ${4 \choose 1}$ ${3\choose 3}$= 20 Case 2 groups of  1, 2, 2 gives ${5 \choose 1}$ ${4 \choose 2}$ ${2 \choose 2}$ = 30 Now here my problem arises. Take case 1 Assume balls to be  A B C D E. You make groups A, B, CDE. Let persons be 1 2 3. The following distributions can be done (one column is one distribution) PERSON 1   A        A      B       B      CDE       CDE  PERSON 2   B       CDE     A      CDE      A         B  PERSON 3  CDE       B      CDE      A      B         A  That is in case 1, each group made can be distributed in 6 ways (3!). Therefore 20 groups can be distributed in 20 x 6 = 120 ways. Similarly for case 2 we get 30 x 6 = 180 ways. Therefore total is equal to 600 ways. But the answer given is 150. Each distribution is taken as 3!/2!. Why is that ? The question specifies different colour balls and to person and persons are always different.

How many ways are there to distribute 5 distinguishable balls between 3 kids such that each of them gets at least one ball?   My approach is $ \binom{5}{3} 3! $ + $ \binom{2}{2} \binom{3}{2}2!$ which is equal to $66$?


I am a executive grade officer working for Sri Lanka government & holding Sri Lankan Official Passport. Currently working as Municipal Commissioner for Anuradhapura Municipal Council. Anuradhapura Municipal Council is a member city of World Tourism Cities Federation (WTCF). Annual world summit of WTCF will be held in Los Angeles from 17-21 september 2017 and received invitation from Los Angelese Tourism & convention board to attend the WTCF world summit. The all expences should be born by WTCF.  I applied B1 visa twice and both applications refused under section 214(b).  I submitted official invitation, Recommendation from Ministry of Foreign Affairs, Sri Lanka.  What I can do next?.  Could I ask for reasons to refuse my visa or to whom I can appeal?

I went for B1 U.S. Visa at the U.S. Embassy in Delhi.   Interviewer: *Good Morning*. Me: *Good Morning* Interviewer: *What is your designation?* Me: *I am a Software Engineer.* Interviewer: *What is the name of your company?* Me: *It is XXX (I replied).* Interviewer: *What is the name of your client?* Me: *It is YYY (I replied).* Interviewer: *Have you ever been to U.S. before?* Me: *NO* Interviewer: *Have you ever been abroad before?* Me: *NO*   At this point he rejected my Visa with letter mentioning 214 (b) as the reason. I don't know why he actually rejected it.  But, I have decent 2+ years of experience with my company. And, I was going on a business meeting with the client. I would have come back after 2 weeks.  I don't know if re applying will help.


I began to use C++ recently,and this may seem to be a nieve queation but I couldn't find an answer for it. When creating an fstream object, I have two options for mode,  binary and txt. fstream f ("file.txt",ios::out|ios::binary); and fstream f ("file.txt,ios::out|ios::binary);  both write the same strings when use the overloaded operator << . my question what is the differwnce between the two modes and does it affect the number of bytes used to write characters to the stream, so you will need a diifferent seekg when you read data written with each fstream ?

What translation occurs when writing to a file that was opened in text mode that does not occur in binary mode? Specifically in MS Visual C.  unsigned char buffer[256]; for (int i = 0; i < 256; i++) buffer[i]=i; int size  = 1; int count = 256;   Binary mode:  FILE *fp_binary = fopen(filename, "wb"); fwrite(buffer, size, count, fp_binary);   Versus text mode:  FILE *fp_text = fopen(filename, "wt"); fwrite(buffer, size, count, fp_text);


ePub3 has become very popular in the recent years because it has had some style-improvements entails much more than before. I am looking for a good ePub viewer that is simple but has great functionality as well. I prefer if there is no download/installation. Any experience? Thanks in advance!

What software can I use to view .epub documents?


Ever since scientists discovered that the fingerprints of each person on earth was unique, fingerprinting has played an important role in law enforcement.   Is the usage of was correct in this sentence,or should it be is/are?

I know the past tense carries the past tense in every dependent clause, but referring specifically to places or to things that are eternal, like the Earth, seems a bit weird and therefore we sometimes (I believe incorrectly) say     He didn't know that New Jersey was actually on the East Coast.   Because it still is. Or     He thought the Earth was round.   So is it square now?  Logically speaking, would you consider the use of past tense here a bit confusing in a day-to-day speech in these examples? Would you instinctively opt for using the present tense?


I would like to numerically simulate a wave (let's say in a string) with different boundary conditions:   Fixed endpoints Periodic  Boundless   $\varphi(x, t)$ is the value of the wave (vertical position of the string) at pixel $x$ captured by a 1-D array phi. For fixed endpoints, I simply pad my array with a zero on the left and one on the right (for numerical differentiation purposes). For the periodic boundary, I pad the left side with the last element (phi[-1] in Python syntax) and I pad the right side with the first element (phi[+1]).  How do I handle the boundless case so a pulse would just travel without reflection similar to the figure below? What is the common term for this type of boundary? (I do not want to sufficiently increase the number of pixels to solve this problem).

In simulating an elastic medium as a series of mobile points connected by ideal springs, it's straightforward to model conditions corresponding to a fixed endpoint, which results in an incoming wave reflecting back inverted, or a free endpoint, so that the wave stays the same way up after it reflects.  I'm doing this with crude 1D difference equations - , if you're interested.  I feel like avoiding reflections without actually simulating an infinite chain should be a tractable problem, but the only papers I'm finding on it are behind a paywall and/or highly complex. There's , for example, which feels like overkill - but maybe this is just one of those problems that looks like it should be fairly easy, but really really isn't?  Edited to add: I'm looking at the Perfectly Matched Layer technique, and also , and starting to worry that some aspects of my physics might be a bit rusty to make sense of this stuff, sixteen years after my degree...


What properties are available to own in Grand Theft Auto V (not GTA Online) and how long before they become profitable?

In GTA5:   What properties are available for purchase? What is their income? What additional benefits do they offer (if any)?


I have posted one blog post about SEO interview questions last month, but I found that someone copied the content of my post and updated in their wordpress blog yesterday with no change. He/she didn’t give link back to my post or anything referring my post. I don’t like this kind of activity. I asked them to give link back to me but no response. My post was cache by Google already and that stolen post hasn’t cache by Google. If it cache by Google will it affect my Post? How avoid those content copies? Does it possible to complaint Google above it?

One of our websites was copied word for word all 400 pages by someone who used a special program to clone the site. We saw the program in the code.   This was done in early April and soon after that we lost a lot of rank in Google. We just discovered the copied site today. It is mirrorred 100%.   We did change the front page of our site since then to make some differences but since the Penguin update, we still have not recovered. We have also corrected the problems in Webmaster Tools. Will the mirrored site affect our Google rank to a severe degree or are there other issues that are affecting us? What can be done about that mirrored site?


Which one is grammatically correct?        One hour and a half is all you have left.   One hour and a half are all you have left.   Two hours is all you have left.   Two hours are all you have left.      And why?

Possible Duplicate:             Can anyone help me determine the correct verb in this sentence? I am not sure what to do. If it were not such a complex introductory phrase, it would be more obvious. The general consensus of my friends who are not professional writers is that the verb should be are.   To me the question is whether or not the subject is singular (i.e., “a large collective volume of paint”, perhaps in a tank) or plural (a lot of the individual gallon containers of paint).  If simplified to other options, it would be like these:   Paint is sold. Gallons of paint are sold. More paint is sold. More gallons of paint are sold. More than 1000 gallons of paint is sold. [emphasis on total volume] More than 1000 gallons of paint are sold. [emphasis on individual containers]


Just wondering which of the following sentences are correct and why?     There is usually a green channel and a red channel at the customs.      There are usually a green channel and a red channel at the customs.   I saw the first sentence in a book, but not sure why using is is correct.

Is the following correct:     There's a sofa, two armchairs, a TV and a big cage for our parrots.   Or should we change it to:     There's a sofa, there are two armchairs, there's a TV and a big cage   for our parrots.


public class AmazonTestClass {  static WebDriver driver; static By cartNumber = By.className("a-dropdown-prompt");   public static void main(String[] args) throws InterruptedException {     driver= new FirefoxDriver();     driver.get("http://www.amazon.co.uk");     Thread.sleep(5000);      driver.manage().window().maximize();      AmazonHomePageClass home= new AmazonHomePageClass();     home.shopAllCategories();     home.shopSubCategory();      SubcategoryProductPage category = new SubcategoryProductPage();     category.clickSeeMoreBrands();     category.clickSelectOneBrand();      ProductsPage product = new ProductsPage();     product.clickProduct();      AddToBasketPage basket = new AddToBasketPage();     basket.clickAddToBasket();      home.enterProductInSearchBox();     home.clickSearchButton();     product.clickProduct();     basket.clickAddToBasket();      basket.clickEditBasket();      assert(driver.findElement(cartNumber).getText().equals("2"));     System.out.println("Quantity of items increased to 2");  }  public class AmazonHomePageClass {  WebDriver driver; By sShopAllCategories = By.id("nav-link-shopall"); By sShopSubCategory = By.xpath("//a[contains(text(),'Bags')]"); By sSearchBox = By.id("twotabsearchtextbox"); private static String searchItem = "Coofit handbag";  By sSearchButton = By.cssSelector("input[value='Go']");  public void shopAllCategories(){      driver.findElement(sShopAllCategories).click(); }  public void shopSubCategory(){      driver.findElement(sShopSubCategory).click(); }  public void enterProductInSearchBox(){      driver.findElement(sSearchBox).sendKeys(searchItem);  }  public void clickSearchButton(){      driver.findElement(sSearchButton).click(); }  }   The below is the error message I get:  Exception in thread "main" java.lang.NullPointerException at com.practice.pageObjectModelExercise.AmazonHomePageClass.shopAllCategories(AmazonHomePageClass.java:18) at com.practice.pageObjectModelExercise.AmazonTestClass.main(AmazonTestClass.java:22)

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Is there a way to do that in WinSCP?  only discusses scripting, while I want a simple GUI solution.

I'm trying to get my Continuous Integration system working from start to finish in the dev environment.  Unfortunately, the last step after publish is copying the folder to an offsite server which I can only access via FTP.  I'd like to have a service running that watches a local folder, and if it changes, updates the FTP server with those changes.  I can't seem to find something to accomplish this in Windows.


I've defined a macro using xparse to have one or two arguments, and to use different commands depending on the number of arguments given. It's been working very well until I had to put one of the macros inside parenthesis, then there's a space added before the closing parenthesis.  MWE:  \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{xparse}  \title{xparse MWE}  \NewDocumentCommand\Da{m+g}{%     \IfNoValueTF{#2}         {#1 Dalton}         {#1 Dalton to #2 Dalton} }  \begin{document} \section*{No parenthesis} Number: \Da{10000} and range: \Da{20000}{30000} \section*{Parenthesis with xparse} Number: (\Da{10000}) and range: (\Da{20000}{30000}) \section*{Parenthesis without xparse - the expected result}[![enter image description here][1]][1] Number: (10000 Dalton) and range: (20000 Dalton to 30000 Dalton) \end{document}   Output:

I see that the code in many packages and examples contains percent signs % at the end of (many) lines. What are they used for? Do they affect the parsing of those lines?


I have a new Dell 5820 i9 workstation. I am trying to load ubuntu-20.04.1-desktop-amd64.iso with USB drive. The installation fails at:  ubuntu install failed detect the available gpus and deal with any system changes  a Radeon Pro WX 5100 card is used. Any help would be great.

Since 2days onwards iam unable to install ubuntu on my windows 10  i am trying to install 20.04 version of ubuntu its appearing like this SQUASHFS ERROR:UNABLE TO READ DATA AND PAGE


the image displayed is mirrored one but it is mirrored on the same side of the object that i want it to be mirrored on the other side of the axis    I just added mirror modifiers from modifiers option in the properties .  I even tried duplicating and adding mirror from the tools , it somewhat works but there is not merge limit and came to know it isn't mirroring properly...because moving half part of the character doesn't make sense to the half mirrored one....morevoer joining and merging those two disables mirror modifiers     otherwise just mirroring it from the tools panel makes half part to disappear

When I add a mirror modifier it sometimes doesn't mirror correctly, giving me an overlapping mesh. How can I fix this?


I was trying to understand egreg's answer to , and I noticed that there were some problems when using lstlisting or tcblisting environments inside the solution environment proposed by egreg, while other environments like figureor proof seem to work fine.  I looked to several related questions (like  and ), and I think (but am not sure) that the conflict comes from the listing package which possibly defines a \BODY command, as does environ.  For example, a minimal non working example is the following :   \documentclass[10pt]{book} \usepackage{environ} \usepackage{listings}  \NewEnviron{solution}{\BODY}  \begin{document}  \begin{solution} This is an environment containing code. \begin{lstlisting} My code \end{lstlisting}  \end{solution}   \end{document}   With this code, I have the following error : Text dropped after begin of listing  Where does this error comes from, and how can I avoid it ?  My goal would be to have a solution environment, defined with \NewEnviron, and which could contain an lstlistingor a tcblisting environment.  Note : I am aware that in the code I have defined, I could use \newenvironment instead of \NewEnviron, but the environment I want (which is exactly the one in egreg's answer to ) really needs the features of \NewEnviron, especially the \BODY macro, since I want to store the content of \solution in order to display it later.

I am trying to use exsheets to prepare the tests for Foundation of Programming exam. I need to include snippets of C code in some question and solution and I am going to use listings (with the options specified in the minimal working example below). However I realised that the code is messed up if injected inside a question or a solution.  Do you know how to work around the problem?    Minimal Working Example  \documentclass{article}  \usepackage{xcolor} \usepackage{listings} \usepackage{exsheets}  \lstset{   frame=single,   xleftmargin=20pt,   numbers=left,   numberstyle=\small,   tabsize=2,   breaklines,   showspaces=false,   showstringspaces=false,   language=C,   basicstyle=\small\ttfamily,   commentstyle=\itshape\color{gray} }  \begin{document}  \begin{question}{6} Consider the following C program. \begin{lstlisting} #include <stdio.h>  int main(int argc, char *argv[]) {   printf("hello, world\n"); } \end{lstlisting} \end{question}  \begin{solution} Consider the following C program. \begin{lstlisting} #include <stdio.h>  int main(int argc, char *argv[]) {   printf("hello, world\n"); } \end{lstlisting} \end{solution}  \pagebreak \printsolutions   \end{document}


I am getting error "Sitemap could not be read". I have tried every option. Does it mean that I should wait to proceed from google. I have added xml file to public_html. I have tested live url that says your site is live and indexed.

I made a fairly simple .txt file I am getting the following errors   I find it very odd. The 2.txt is just the .txt with fewer than 50,000 results. Somehow it seems like Google can read the longer .txt file but not the shorter 2.txt file.


On every app start there is a error message on my phone: "The Application was ended, sorry". What can I do now? I already searched the web and I tried to solve it, but I didn't found a answer.  This is my logcat output:     FATAL EXCEPTION: main Process: mycompany.kopfrechnenti1907_1839, PID: 524 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{mycompany.kopfrechnenti1907_1839/mycompany.kopfrechnenti1907_1839.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2363)   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)   at android.app.ActivityThread.access$900(ActivityThread.java:158)   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)   at android.os.Handler.dispatchMessage(Handler.java:102)   at android.os.Looper.loop(Looper.java:148)   at android.app.ActivityThread.main(ActivityThread.java:5521)   at java.lang.reflect.Method.invoke(Native Method)   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:804)   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:666) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference   at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:120)   at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:155)   at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:31)   at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:55)   at android.support.v7.app.AppCompatDelegateImplV23.<init>(AppCompatDelegateImplV23.java:33)   at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:203)   at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185)   at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:519)   at android.support.v7.app.AppCompatActivity.findViewById(AppCompatActivity.java:190)   at mycompany.kopfrechnenti1907_1839.MainActivity.<init>(MainActivity.java:10)   at java.lang.Class.newInstance(Native Method)   at android.app.Instrumentation.newActivity(Instrumentation.java:1069)   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2353)   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)    at android.app.ActivityThread.access$900(ActivityThread.java:158)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)    at android.os.Handler.dispatchMessage(Handler.java:102)    at android.os.Looper.loop(Looper.java:148)    at android.app.ActivityThread.main(ActivityThread.java:5521)    at java.lang.reflect.Method.invoke(Native Method)       import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.RatingBar; import android.widget.Button;  public class MainActivity extends AppCompatActivity {      Button btnplus = (Button)findViewById(R.id.btnplus);     RatingBar ratingbar = (RatingBar)findViewById(R.id.ratingBar);       @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);     }      public void plusonclick()     {         if (ratingbar.getRating() == 1)         {             setContentView(R.layout.activity_plusrechnenlvl1);         }     }  }   My English skills are not the best, but I hope you can understand me :)  Thank you very much!  Jul


I want to generate random DOB for the given range of year. So I tried the below code  private static String randomDataOfBirth(int yearStart, int yearEnd)     {         GregorianCalendar gc = new GregorianCalendar();         int year = randBetween(yearStart, yearEnd);         gc.set(Calendar.YEAR, year);          int dayOfYear = randBetween(1, gc.getActualMaximum(Calendar.DAY_OF_YEAR));              gc.set(Calendar.DAY_OF_YEAR, dayOfYear);             String date = null;             if(gc.get(Calendar.MONTH) == 0)             {                  date = gc.get(Calendar.YEAR) + "-" + 1 + "-" + gc.get(Calendar.DAY_OF_MONTH);             }else             {                  date = gc.get(Calendar.YEAR) + "-" + gc.get(Calendar.MONTH) + "-" + gc.get(Calendar.DAY_OF_MONTH);             }             return date;         }  private static int randBetween(int start, int end) {         // TODO Auto-generated method stub          return start + (int)Math.round(Math.random() * (end - start));     }   Main:-  public static void main(String[] args) { String dob = randomDataOfBirth(1899, 1937); System.out.println(dob); }   I can be able to generate the random DOB. But only for the Month and Day, I want to add a prefix '0' for the range from 1 to 9   Month - 01, 02, 03 and ... up to 09 Day - 01, 02, 03 and ... up to 09

How do you left pad an int with zeros when converting to a String in java?  I'm basically looking to pad out integers up to 9999 with leading zeros (e.g. 1 = 0001).


How does a person remove/purge residual files after uninstalling/purging an application?   After uninstalling AirVPN Eddie client via   sudo apt-get remove --purge airvpn   I still have the affected (corrupted?) conf files in the /etc directory. I'm looking for other files that remain that are keeping my wifi from working. See this question:    Right-clicking and deleting these files doesn't work. What is the proper command to take ownership of hidden and system files and delete them?

In my quest to fix a conflict with AirVPN client and AA 17.10, I have decided to uninstall Air and remove all residual files, threads, ect.     Investigating the uninstall, I have come across this code   dpkg -l | grep '^rc' | awk '{print $2}' | xargs dpkg --purge   which runs after the command  apt-get --purge airvpn    These, when run together are as thorough as possible for removing all related files.   Is this safe code for the uninstall project at hand?  I will re-install Air once the residuals are removed as to not create conflicts.   Thanks for your comments and suggestions.


I am reading the following material:  . At page 5, there is a proof classifying all groups with order $pq$(they are all primes and $p$ is not equal to $q$). I am lost in the last two sentence, which claims the semidirect product are all isomorphic. Could someone help me to understand it? Thanks!

Let $G$ be a group of order $pq$, $p>q$  and $p$, $q$ are primes. Then prove that  If $q\mid p-1$ then there exists a non abelian group of order $pq$. Any two non-abelian groups of order $pq$ are isomorphic.   I have proved that if $q\not\mid p-1$ then $G$ is cylic . But how to prove this one I have no idea. Any kind of hint is very much welcome. This problem is in Herstein book, page 75.


Let <A,≺ > is a linear ordered set which does not have a largest element. For a set X, X ⊆ A, is said to be cofinal with A, if: (∀a ∈ A)(∃x ∈ X)[a ≺ x]. Prove that there exists B, B ⊆ A, which is cofinal with A and <B,≺> is well ordered set. My attempt: Will use recursion,namely if we define a property φ, such that for ∀x∃y(φ,x,y). Then for every A there exists set B, such that:∀y(y∈B)↔(∃x|x∈A & (φ,x,y) ). But this property φ,x,y I will use to define a surjection over an ordinal α-the largest limit ordinal which I will consider to be Limit(α), here I use the fact that ¬max α'∈A. This surjection will be: f:α ↦A. Which for an arbitrary x∈α will return s(x)≤α,namely f(x)=s(x). If however x>a, then x=α+n. Hence we have showed the existence of such x:a ≺ x. Then this says that for this defined operation and the set A, there exists other set B(unique) satisfying the property. However I do not know what else I need to do to get further.

I thought this was easy until I realized that for a set to be well-ordered, EACH of it's non-empty subsets must have a least element.  Let $A$ be a non-empty totally ordered set. Let $x_0$ be some element of $A$. Define $S=\{x\in A|x\ge x_0\}$. $x_0 \in S$ so $S$ isn't empty.  Now, this seems like it would work. It certainly is totally ordered and cofinal in $A$, but it might not be well-ordered.  For example, if $A=\mathbb R$ then $(x_0 + 1, x_0 + 2)$ (where $()$ denotes an open interval) is a non-empty subset of $S$, but doesn't have a least element.


I have a really weird wifi problem with just my laptop. On my phone etc. it works. When I connect with a cable to my laptop it works.  Is there a Stack Exchange website for this kind of problem?

Recently I wondered about a webcam on my laptop; about the driver problem with it and about all stuff related to devices and hardware. I see, that the Stack Exchange network has Q&A about: programming and servers mostly, but what about hardware specifically? Is there or will there be a Stack Website just for hardware? About: HDD, RAM, CPU, motherboards, graphic cards, etc.?  I hope I don't repeat an already asked question, but since there is no distinct answer for it I asked it as I see it.


My PG is a Shade, so:     Racial Traits       As creatures of the Plane of Shadows, shades are considered to be of the outsider type.   So far so good. The problem is: if the Shade race is already a little unbalanced, how does the outsider type interact with it?  Do I get the Outsider features?     Outsider Type      Features      An outsider has the following features.      8-sided Hit Dice.    Base attack bonus equal to total Hit Dice (as   fighter).    Good Fortitude, Reflex, and Will saves.  Skill points equal   to (8 + Int modifier, minimum 1) per Hit Die, with quadruple skill   points for the first Hit Die.      From:

When a character becomes a 10th level Alienist (prestige class), the following change is said to occur (emphasis mine):     Alien Transcendence (Su): A 10th-level alienist, because of long   association with alien entities and intense study of insane secrets,   transcends her mortal form and becomes an alien creature. Her type   changes to outsider. Additionally, she gains damage reduction 10/magic   and resistance to acid 10 and electricity 10. Upon achieving alien   transcendence, an alienist undergoes a minor physical change, usually   growing a small tentacle or other strange feature, such as an extra   appendage, organ, eye, or enigmatic lump. An alienist can hide this   abnormality in a robe or hood, but the alien growth is not under the   alienist's control and sometimes moves, twitches, opens, or otherwise   animates of its own accord. This applies a —4 penalty on Disguise   checks an alienist makes to conceal her true nature. Anyone who shares   an alienist's predilection for study of the Far Realms immediately   recognizes her transcendent nature, and she gains a +2 circumstance   bonus on all Charisma- based skill checks and ability checks when   interacting with such beings. She gains a +2 circumstance bonus on   Intimidate checks involving any other creatures to whom she reveals   her abnormal nature.   So the character becomes an outsider. d20srd describes outsiders as such:     Features      An outsider has the following features.         8-sided Hit Dice.   Base attack bonus equal to total Hit Dice (as fighter).   Good Fortitude, Reflex, and Will saves.   Skill points equal to (8 + Int modifier, minimum 1) per Hit Die, with quadruple skill points for the first Hit Die.         Traits      An outsider possesses the following traits (unless otherwise noted in   a creature’s entry).         Darkvision out to 60 feet.   Unlike most other living creatures, an outsider does not have a dual nature—its soul and body form one unit. When an outsider is   slain, no soul is set loose. Spells that restore souls to their   bodies, such as raise dead, reincarnate, and resurrection, don’t work   on an outsider. It takes a different magical effect, such as limited   wish, wish, miracle, or true resurrection to restore it to life. An   outsider with the native subtype can be raised, reincarnated, or   resurrected just as other living creatures can be.   Proficient with all simple and martial weapons and any weapons mentioned in its entry.   Proficient with whatever type of armor (light, medium, or heavy) it is described as wearing, as well as all lighter types. Outsiders   not indicated as wearing armor are not proficient with armor.   Outsiders are proficient with shields if they are proficient with any   form of armor.   Outsiders breathe, but do not need to eat or sleep (although they can do so if they wish). Native outsiders breathe, eat, and sleep.      For one, I would tend to believe the character is a native outsider at this point, because it not only has ancestors in the material plane, it was born on it. Am I right?  Now, more importantly, what benefits does the alienist gain from becoming an outsider? Here are a few that they could possibly gain:   More HP. If so, are all Hit Dice from previous character levels rerolled as d8, or is it only from that level onward? The same base attack bonus as the Fighter's, along with the extra attacks that come with it. If so, is this for total character levels or only from this level onward? Improved saving throws (if so, by how much?) More skill points (8 + int instead of 2 + int). If so, does the character get skill points from previous levels or is it from that level onward? Darkvision (60 ft / 12 spaces) Impossible to resurrect unless using true resurrection, wish or miracle if not a native outsider (see above) Proficiency with all simple and martial weapons No need to eat or sleep if not a native outsider (see above)


When dealing with a particle as represented by a probability field, how is mass distributed across the field? Would the mass be averaged across the field?

One of the postulates of QM mechanics is that any observable is described mathematically by a hermitian linear operator.   I suppose that an observable means a quantity that can be measured. The mass of a particle is an observable because it can be measured.  Why then the mass is not described by a linear hermitian operator in QM?


Is there a way (which does not cost a buck) to switch between windows across desktops with Option Tab? Not between apps, but between windows.  Meaning: if I have a Chrome window on desktop 1 and another on desktop 2, just by Option Tab'ing, I could switch across both.

I opened two Google Chrome windows (because I am using multiple Gmails) and when I do the Cmd ⌘ Tab ⇥ shortcut it just shows me other applications that I opened but does not show me the other Chrome windows that are already opened.  How to switch to the other Google Chrome window that I opened using keyboard shortcut?


When I do this in beamer:  \begin{column}[T]{0.6\textwidth} \begin{equation} F = m a \end{equation}  This is Newton's law. \end{column}   the equation sits in the center of the column while the text is flushed left. How do I make both flush left?

How can I left align the display math environment (either $$ or \[)? I keep running into people asking about the align environment; but I just want to change displayed math from center to left align relative to the page.


When working on my Cordova project, I didnt have a .gitignore file, so when i committed everything (by way of git add *, it seemed to commit all my platforms, .idea, and plugins.  So, this is now pushed to GIT, but I wanted to dereference them, so they arent downloaded in the future.  I just created a new Cordova .gitignore as follows.    #Cordova Info platforms/ plugins/  # ANDROID / ECLIPSE  # built application files *.apk *.ap_  # files for the dex VM *.dex  # Java class files *.class  # generated files - android project subfolder Android/bin/ Android/gen/ Android/assets/  # generated files bin/ gen/  # Local configuration file (sdk path, etc) local.properties  # IOS / Xcode build/* *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 *.xcworkspace !default.xcworkspace xcuserdata profile *.moved-aside IOS/www/  # OSX .DS_Store  # Thumbnails ._*  # Files that might appear on external disk .Spotlight-V100 .Trashes     I ended up grabbing the "PhoneGap GitIgnore" and added platforms and plugins to it at the top.  So it comes down to 'how do i unlink the platforms and plugins folders and is this a solid gitignore for Cordova 6.3.0' ?

I accidentally committed an unwanted file (filename.orig while resolving a merge) to my repository several commits ago, without me noticing it until now. I want to completely delete the file from the repository history.   Is it possible to rewrite the change history such that filename.orig was never added to the repository in the first place?


Let $n \geq 3.$ Show that $Z(D_n) \cong \Bbb Z_2$ if $n$ is even, and $Z(D_n)=\{e\}$ when $n$ is odd.  First, let $n$ be odd. Assume for the contrary that there exists $\sigma \in D_n$ such that $e \neq \sigma$ and $\sigma \tau=\tau \sigma$ for all $\tau \in D_n$, where $e$ denotes the identity in $D_n.$ Since $\sigma \neq e$, there exists $i,j$ positive distinct integers such that $\sigma(i)=j.$ Let $k \neq i,j$ and let  $\tau=(i k)$\ (such a $k$ exists since $n \geq 3$). By our assumption, we should have $\sigma \tau=\tau \sigma$, so $$\sigma(\tau(i))=\sigma(k)\neq j=\tau(j)=\tau(\sigma (i))$$ a contradiction, so $\sigma$ must equals $e$. Hence, $Z(D_n)=\{e\}$ i.e the $Z(D_n)$ is trivial, for $n$ odd.  I feel i am ok with the part when $n$ is odd, but i am getting stuck when the case $n$ is even. So I would really appreciate any help or thoughts about that.  An alternative proof:  assume that $e \neq g \in Z(D_n)$. Then, $g=a^ib^j$ where $1 \leq i \leq n,\ \ j \in \{0,1\}$, so we have two cases:\ case (i) $g=a^i$. By the assumption that $ g \in Z(D_n)$ and the relation between $a,b$, we have $a^ib=ba^i=a^{-i}b$, therefore $a^i=a^{-i}$ which implies that $e^{2i}=1$. So $e^{2i}=1=e^n$ which means $i=\frac{n}{2}.$\ case(ii) $g=a^ib$. By assumption and the relation between $a,b$,$$a^i=(a^ib)b=b(a^ib)=(ba^i)b=a^{-i}bb=a^{-i}$$ so $a^{i}=a^{-i}$, which implies $i=\frac{n}{2}$. Also, for $a$ we have $$(a^ib)a=a^i(ba)=a^{i-1}b=a(a^ib)=a^{i+1}b$$ i.e $a^{i-1}=a^{i+1}$ here we have $a^2=1$, so what does that mean? and how to show $D_n \cong Z_2$ when $n=2k.$  Thank you.

I am trying to solve the following exercise about the dihedral group and its center:  If $g\in Z(D_{2n})\Leftrightarrow ga=ag, bg=gb$, where $a,b$ are generators of $D_{2n}$.  We have defined the dihedral group of order $2n$ as $D_{2n}=\left \{ a^{i}b^{j} \mid 0\leq i \leq n, j=0,1 \right \}$, the group of all finite products of the generators $a$ and $b$,  where  $a= \bigl(\begin{smallmatrix}     1 & 2 & 3 & \cdots & n-1 & n \\     \end{smallmatrix}\bigr)$ and $ b = \bigl(\begin{smallmatrix}     1 & 2 & 3 & \cdots & n-1 & n \\     1 & n & n-1 & \cdots &  3  & 2   \end{smallmatrix}\bigr)$  For the first part ( $\Rightarrow $) i have considered an element $g$ of the center $Z(D_{2n})$, $g$ is also in $D_{2n}$, so it can be written as a finite product of powers of $a$ and $b$. Let's say $g=a^{k}b^{l}$ for $0 \leq k \leq n$ and $j=0$ or $j=1$.  Then i can write $ga = a^{k}b^{l}a=a^{k+1}b^{l}$ and $ag=aa^{k}b^{l}=a^{k+1}b^{l}$. So $ga=ag$. The same for $gb=bg$.   Is this correct? How to start with the other part of the proof? I would appreciate any help and hints. Thank you in advance.


It seems it's just as easy to transport someone or something to any part of the ship as a transporter pad (at least TNG era). Other than maybe a place to welcome guests, it seems largely unnecessary (except perhaps particularly complex operations like removing that transporter space worm out of Barclay). Do the transporter room and pads have more power, or other benefit than transporting someone directly to their room/sickbay/bridge?

I hope this isn't a silly question but I've been watching TNG and this bothers me.  The transporter 'pad' area is relatively small.  As a guess, maybe 12 people can fit on it.  But the vast majority of times it's being used by 2-3 people.  However, the transporter is able to beam people from anywhere on the ship to anywhere (within some distance I presume).  It's fairly common for them to perform a transport directly to the bridge.  So, why is there an actual room?    If a three man away team is to beam down to the surface of a planet - why do they have to walk all the way to the transporter room, then stand on the pad to get down there?  Why not simply beam them from where they are, to the surface.  The ship's computer is able to locate anyone on board.


This is an example of a Binary Tree implementation . This code works ok. But can I create the root as single one-time node in add method.   Instead of  public void add(int value) {  root = addRecursive(root, value); }   i do   public void add(int value) {  if (root == null) {   root= new Node(value);     } // then i add left- and right-leafs recursively if (value < root.value) {    root.left = addRecursive(root, value);         } else if (value > root.value) {   root.right= addRecursive(root, value);   } }   And if I add 3 or less nodes - that's all right   bt.add(2); bt.add(1); bt.add(3);   but if I add more then 3 nodes I get StackOverflow Error because of recursive function  private Node addRecursive(Node current, int value) {        if (current == null) {        return new Node(value);   }      if (value < current.value) {   current.left = addRecursive(current.left, value);        } else if (value > current.value) {     current.right = addRecursive(current.right, value);         }     return current; }

What is a StackOverflowError, what causes it, and how should I deal with them?


Suppose $f'$ is continuous and positive on $[a, b]$. Prove $$\int_a^b f(x) dx + \int_{f(a)}^{f(b)} f^{-1} (y) dy = b f(b) - a f(a)$$  I'm attempting to apply a change of variables but unsure where to start.

I just wanted to ask, if my proof is correct. I haven't seen the equation before, but I think it's quite useful.  Let $f$ be an bijective differentiable function. Then the inverse function $f^{-1}$ exists and the following equation holds:     $$\int\limits_{a}^{b} f(x) dx = b \cdot f(b) - a \cdot f(a) - \int\limits_{f(a)}^{f(b)} f^{-1}(x) dx$$   Proof.  $f$ is an bijective differentiable function and $F$ is an antiderivative of $f$.  First we need to find an antiderivative of $f^{-1}$.  $\int f^{-1}(x) dx$ with substitution $x = f(y)$ yields:  $$\int y \cdot f'(y) dy = y \cdot f(y) - \int f(y) dy = y \cdot f(y) - F(y)$$  resubstitution yields:  $$\int f^{-1}(x) dx = x \cdot f^{-1}(x) - F(f^{-1}(x))$$ hence $\int\limits_{f(a)}^{f(b)} f^{-1}(x) dx = \left[x \cdot f^{-1}(x) - F(f^{-1}(x)) \right ]_{f(a)}^{f(b)}$  $$=b \cdot f(b) - F(b) - (a \cdot f(a) - F(a)) = F(a) - F(b) + b \cdot f(b) - a \cdot f(a)$$ $$= \int\limits_{b}^{a} f(x)  dx + b \cdot f(b) - a \cdot f(a) = -\int\limits_{a}^{b} f(x)  dx + b \cdot f(b) - a \cdot f(a)$$  All in all:  $$\int\limits_{f(a)}^{f(b)} f^{-1}(x) dx = -\int\limits_{a}^{b} f(x)  dx + b \cdot f(b) - a \cdot f(a)$$   which is equal to     $$\int\limits_{a}^{b} f(x) dx = b \cdot f(b) - a \cdot f(a) - \int\limits_{f(a)}^{f(b)} f^{-1}(x) dx$$   q.e.d.


Given a set of $N$ increasing real numbers $\{E_1, E_n, \cdots, E_N \}$, is it always possible to find a potential $V(x)$ such that the set of $\{E_j\}$ are the lowest eigenvalues of the corresponding one-dimensional Schrödinger equation for given mass?

A typical problem in quantum mechanics is to calculate the spectrum that corresponds to a given potential.    Is there a one to one correspondence between the potential and its spectrum?  If the answer to the previous question is yes, then given the spectrum, is there a systematic way to calculate the corresponding potential?


I'm new to Spring and I have a question about how it works.  Why is the interface instantiated in Spring framework and not the class that implements it?  I have seen several tutorials and they all do the same but I can not understand why  The interface:  public interface ILoginServicio {     public String getLogin(String usuario, String contrasena);     public boolean getMultiSearchResult(DirContext dirContext, String searchFilter, String searchBase);     public boolean displayAttribute(String attrName, final Attributes attributes); }   The class implementing the interface:  @Service public class LoginServicioImpl implements ILoginServicio{      @Autowired     private Environment environment;      @Override     public String getLogin(String usuario, String contrasena) {         ....     }      @Override     public boolean getMultiSearchResult(DirContext dirContext, String searchFilter, String searchBase) {         ...         return flagActiveDirectory;     }      @Override     public boolean displayAttribute(String attrName, Attributes attributes) {         ....         return flagActiveDirectory;     } }   Restcontroller class where the bean is injected to:  @RestController public class Login {      @Autowired     ILoginServicio iLoginServicio;      @RequestMapping("/login")     public Respuesta<String> login(@RequestBody UsuarioLogin user){         //.......     } }

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


I want to show data from sql in my php page but I get this error:      "Error: SQLSTATE[42000]: Syntax error or access violation: 156   [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax   near the keyword 'user'. (SQLExecute[156] at   ext\pdo_odbc\odbc_stmt.c:258)"   This is the code I am using and when I check if the odbc:odbc2sqlserver connection it says 'true'.  I searched on other questions but I could not find working answer.

                 <?php                 echo "
";                 echo "
UserID	Username	Password	Beheerder
";                  class TableRows extends RecursiveIteratorIterator {                     function __construct($it) {                         parent::__construct($it, self::LEAVES_ONLY);                     }                      function current() {                         return "" . parent::current(). "	";                     }                      function beginChildren() {                         echo "
";                     }                      function endChildren() {                         echo "
" . "\n";                     }                 }                  $servername = "localhost";                 $username = "root";                 $password = "";                 $dbname = "Taaltrainer";                  try {                     $conn = new PDO("odbc:odbc2sqlserver");                     $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);                     $stmt = $conn->prepare("SELECT * FROM user");                     $stmt->execute();                      // set the resulting array to associative                     $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);                     foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) {                         echo $v;                     }                 }                 catch(PDOException $e) {                     echo "Error: " . $e->getMessage();                 }                 $conn = null;                 echo "
";                 ?>

One of my columns is called from. I can't change the name because I didn't make it. Am I allowed to do something like SELECT from FROM TableName or is there a special syntax to avoid the SQL Server being confused?


How can I get rid of the keyboard indicator icon in the Notification area?  I am running Ubuntu 13.10

/desktop/gnome/peripherals/keyboard/general/disable_indicator in gconf is set to yes Additionally I restarted, but it's still there. Maybe there is some setting buried in CCSM?  here is screenshot of what I'm talking about if it's not clear:  I want to remove it if possible


When a star ship is traveling at warp 9.999, how can it quickly maneuver out of the way of planets? Since this is pretty dang fast, how far do sensors have to reach out ahead at that speed to help them maneuver without colliding with a planet, meteor or star?

A similar question on the functionality of sensors can be found , but my question goes beyond that (pun intended).  What is the range (distance) of the sensors of the Enterprise-D?  My understanding (and correct me if I'm wrong here please) is that there are three types of sensors: long-rage, short-range and visual (ie the viewscreen).  What exactly is the range of these three types of sensors (as in what is the maximum distance they can each detect something)?  I know from several TNG episodes the Enterprise can apparently scan an entire system when it is in it, but that's rather ambiguous I think - I'm looking for a unit of measurement (km - although that's probably an underestimate of the Enterprise-D's abilities I'm sure).


I'm using Illustrator CC and my paths appear pixelated. I have no idea what may have caused the pixelation since it just started happening out of the blue. The image I've attached shows the saved jpg version of the image vs. the image displayed in Illustrator. Please help!

This has been puzzling me for a few days now, and I asked a graphic designer I knew before trying here and haven't been able to solve it yet. It's quite weird so please bear with me for a bit.  I am using Adobe Illustrator to create a logo, and I have something that can potentially work. I have used only the pen tool with strokes (no fill), but the issue is, when I view the logo at 100%, it looks pixellated! I know vectors should not even be able to appear pixellated, but they are. Here is the screenshot from AI, without exporting to anything:     That was just done using the snipping tool within Windows, and it's at 100% zoom.  I have anti-aliasing turned on from Edit > Preferences > General, and the document resolution is at 300 ppi (I get the same result with 72 ppi).   Could anyone help me with this?   If relevant: Using CS6, and have a 24 inch Dell U2412M at 1920x1200 resolution. I do have a 21.6" Samsung at 1680x1050 and I get the same result there as well. Let me know if you need any other settings, or if you would like the file, I'd be happy to provide it to be able to solve this problem.


Let $F : \mathbb{R}\to \mathbb{R}$ be a monotone function then Prove that  $F$ has countably many discontinuities.  Edit: Monotone function is not only increasing.  My Attempt :  I know that the set of discontinuities of a monotone function is at most countable. If I take greatest integer function $[x]$ which is monotone function that has countable set of discontinuities as $\Bbb Z $. But I'm unable to Prove it. Please help me.

The result I am trying to prove is the following:     Let $F:\Bbb R\to\Bbb R$ be increasing. Then the set of points, at which it is discontinuous, is countable.   I have been reading this form Folland's Real Analysis and he proves this by considering the sum $\sum_{|x|<N}[F(x^+)-F(x^-)]$ which has to be finite by some sort of telescoping sum. Now, I am not sure how he defines this sum. I am assuming he does this by using nets (let me know if there is another way to look at this), but he doesn't introduce the concept of nets until the next chapter. So I was looking for some other ways to prove this result and I found the following result (from Stein-Shakarchi) which is quite similar but assumes $F$ to be bounded.      A bounded increasing function $F$ on $[a,b]$ has at most countably many discontinuities.   This is shown by using the density of rationals in $\Bbb R$, i.e. $\exists r_x\in\Bbb Q$ s. t. $F(x^-)<r_x<F(x^+)$ corresponding to each point of discontinuity $x$.   Now I feel like there shouldn't be a problem in doing the exact same thing for unbounded increasing function. Is this right? Secondly how does this proof relate to the first one? I feel like there isn't much of a difference between the two proofs. To be precise I think that the previous sum is well defined/finite because of this countability of discontinuous points. What do you think about this way of thinking?  Edit. Here is the Folland's proof in more detail:  Since $F$ is increasing, the intervals $(F(x^-),F(x^+))$ are disjoint for all $\forall x\in\Bbb R$. Moreover,  $\forall|x| < N$ such intervals are contained in $(F(-N),F(N^+))$ and so  $$\sum_{|x|<N}[F(x^+)-F(x^-)] \leqslant F(N) - F(-N) < \infty. $$ Hence the set $\{ x \in (-N,N) : F(x^+) \neq F(x^-)\}$ is countable.


I want to press char by java script instead of keyboard (just for my education). I have input and I want to press key inside it, but it doesn't work (I know that initKeyboardEvent is only in Chrome, I use Chrome), what is wrong in this code?  <input id="edit"> <script>     var inp = document.getElementById('edit');     inp.focus();      var ev = document.createEvent('KeyboardEvent');      ev.initKeyboardEvent(         'keypress', true, true, window, false, false, false, false, 49, 0);      document.body.dispatchEvent(ev); </script>

Is it possible to simulate key press events programmatically in JavaScript?


Have a look at this Excel graph:  The 'common sense' line-of-best-fit would appear be an almost vertical line straight through the center of the points (edited by hand in red). However the linear trend line as decided by Excel is the diagonal black line shown.  Why has Excel produced something that (to the human eye) appears to be wrong? How can I produce a best fit line that looks a little more intuitive (i.e. something like the red line)?   Update 1. An Excel spreadsheet with data and graph is available here: , . Are the type1 and type2 regression techniques available as excel functions? Update 2. The data represent a paraglider climbing in a thermal whilst drifting with the wind. The final objective is to investigate how wind strength and direction varies with height. I'm an engineer, NOT a mathematician or statistician, so the information in these responses has given me a lot more areas for research.  This is an interesting thread and It would be a shame for the data to be lost and someone in future unable to reproduce the examples, so I'm adding it as a comment here (which is the data from ). "lon","lat" -0.713917,53.9351 -0.712917,53.93505 -0.712617,53.934983 -0.712333,53.9349 -0.7122,53.93475 -0.71215,53.934567 -0.712233,53.9344 -0.712483,53.934233 -0.712817,53.934167 -0.713217,53.934167 -0.713617,53.934267 -0.7141,53.934733 -0.714133,53.935 -0.71395,53.935283 -0.713617,53.9355 -0.713233,53.935617 -0.712767,53.935617 -0.712383,53.9355 -0.712183,53.9353 -0.712367,53.934883 -0.712717,53.934767 -0.713133,53.9348 -0.713583,53.934917 -0.713867,53.93515 -0.714017,53.935433 -0.7139,53.935717 -0.7136,53.935933 -0.71325,53.936067 -0.712833,53.936133 -0.7124,53.936117 -0.712083,53.935983 -0.7119,53.935767 -0.711917,53.935567 -0.7121,53.935383 -0.7124,53.935283 -0.712733,53.93525 -0.713117,53.935267 -0.7135,53.93535 -0.713817,53.935517 -0.71405,53.935733 -0.71415,53.935983 -0.7141,53.93625 -0.7139,53.9365 -0.713567,53.936667 -0.713183,53.936767 -0.712767,53.9368 -0.7124,53.9367 -0.712133,53.93655 -0.712033,53.936333 -0.712167,53.936167 -0.712383,53.936017 -0.712733,53.935917 -0.7132,53.93595 -0.713567,53.936067 -0.713867,53.936267 -0.714067,53.9365 -0.71415,53.936767 -0.714033,53.937033 -0.71375,53.937233 -0.7134,53.9374 -0.712967,53.93745 -0.71255,53.937433 -0.7122,53.937267 -0.712067,53.937033 -0.712117,53.9368 -0.712367,53.936617 -0.712733,53.936533 -0.713133,53.93655 -0.713467,53.93665 -0.71375,53.93685 -0.713933,53.937083 -0.71395,53.937367 -0.713767,53.937633 -0.713433,53.937833 -0.713033,53.937967 -0.712567,53.937967 -0.71215,53.937867 -0.711883,53.93765 -0.711817,53.937433 -0.711983,53.937233 -0.71265,53.937033 -0.713067,53.9371 -0.713683,53.93745 -0.713817,53.937983 -0.713633,53.938233 -0.7133,53.938433 -0.71285,53.938533 -0.71205,53.938333 -0.71185,53.938117 -0.711867,53.937867 -0.712067,53.9377 -0.712417,53.937583 -0.712833,53.937567 -0.713233,53.937667 -0.713567,53.937883 -0.7137,53.938417 -0.713467,53.93865 -0.713117,53.938817 -0.712683,53.938917000000004 -0.71225,53.938867 -0.711917,53.938717 -0.711767,53.938483 -0.711883,53.938267 -0.712133,53.9381 -0.712483,53.938017 -0.713283,53.93815 -0.713567,53.938333 -0.7138,53.938567 -0.713683,53.9391 -0.713417,53.9393 -0.71305,53.939433 -0.7126,53.939483 -0.7122,53.9394 -0.711917,53.93925 -0.711783,53.93905 -0.7118,53.938817 -0.711967,53.938667 -0.712217,53.938533 -0.712567,53.938433 -0.712933,53.93845 -0.7133,53.938567 -0.713583,53.93875 -0.71375,53.939

I have fit the following linear model, I tested the response by looking at a qq plot and it is almost perfectly linear. When i fit the model though, and study the predicted vs observed plot, It looks like this:    What does this tell me exactly? It seems to me that a better fitting line would be gained if i pivoted the model slightly to match the slope of the points. I'm not sure what I can do to gain a better predictive model.  edit  i trained the linear model on my training set. The 'predicted' in the plot are the result of applying that model to an independent 'test' set, and comparing it wth the observed values for that test set. The line is found by abline(0,1)


I used a   on overleaf. Yesterday, it worked pretty well. However I face a problem today. It is a warning:  /usr/share/texlive/texmf-dist/tex/latex/moderncv/moderncvheadiii.sty: LaTeX Warning: You have requested package `moderncvheadiii',                but the package provides `moderncvheadiii'. /usr/share/texlive/texmf-dist/tex/latex/moderncv/moderncvbodyiii.sty: LaTeX Warning: You have requested package `moderncvbodyiii',                but the package provides `moderncvbodyiii'.   Then a new blank line (the red circle part) comes out between address and phone, while it did not exist before.     I do not know why... overleaf is a online edit environment, I did not changed anything of the original template. How could it appear a warning suddenly? I hope anyone could help me.  here is the related code:  \documentclass[11pt,a4paper,sans]{moderncv} \moderncvstyle{banking} \moderncvcolor{blue} \usepackage[utf8]{inputenc} \usepackage[scale=0.75]{geometry} \usepackage{import}  \name{My}{Name} \title{Curriculum Vitae} \address{my address, line 1, line 2, line 3, postcode}{}{} \phone[mobile]{+44 12345 12345}  \phone[fixed]{01234 123456}  \email{myname@hotmail.co.uk}      \homepage{www.myname.webs.com}

Moderncv has a line of empty space between address and phone/email, like this:   MWE:  \documentclass[12pt]{moderncv} \moderncvstyle{banking} \name{Sherlock}{Holmes} \address{221B Baker Street}{London}{U.K.} % Your current address \phone[mobile] {+44~(0)71234 00000}    % Your mobile phone number \email{superdetective@mail.com}  \begin{document} \makecvtitle \end{document}   How do I remove/decrease that space by shifting the phone and email line up?


There is a major difference in the warp scales used in Star Trek TOS and TNG onwards (or am I wrong in this?).  I was wondering if there was a conversion system out there to see what the equivalent of, say, warp 8 in TOS era was in TNG era?

From  onward,  has a basically cubic scale from warps 1 - 9. But then, close to warp 10, it suddenly develops its own puzzling scale, as can be seen in .  In this scale, , occupying all points in the universe simultaneously and therefore effectively teleporting instantaneously.  My question is why have this confusing scale? Why not have a uniform cubic scale? Was there ever any "official" explanation for this?  Clarification: I'm looking for why the writers decided on this, not the "in-universe" explanation.


I use tilda as my terminal on Ubunut 14.10. The trouble I have is that I want to have the tab bar, since the titles in it are actually useful for navigation, but having username@computer:~/some/folder is irritating. So I looked around, and yes, I can change bash's title so that it doesn't display the username and computer.  But that only partially solves the problem, because even if I only have the pwd as the title, it grows really fast. And I don't need the whole path, so I was wondering if there is a way to set the maximum size of the title. So that if I'm in   /home/username/Downloads/some_unzipped_folder/subfolder/   The title is displayed as   /home/usern...folder/subfolder/   depending on how much width I set, so that I get some useful information from the title, but not have my tab bar in tilda fill up quickly.

When using the terminal in a deep folder structure sometimes the prompt can take up most of the line.  Is there any way in which I can trim the working directory?  I know I can do  PS1="\W >"   to only print the current directory and not the full path, but is there a way to have something like:  /home/smauel/de...ther/folder >