Does Samsung Galaxy Grand 2 support Otg?  I have read various opinions but they are all very confusing...  Please help.

Some Android devices can act as a USB host, so that you can use other USB devices attached to them. For instance, browse or import the photos stored on a camera from your phone, or copy files onto a USB memory stick attached to your tablet, plug a full-size USB keyboard or mouse into a tablet, or use an external GPS or wifi device.  How can I tell if my device can do this?


I'm running Ubuntu 14.04.1 LTS Server on an Asus Eee PC netbook.  Back when I had 12.04 installed, I was able to close the netbook and the system would stay running. Now with 14.04, closing the netbook puts the system in suspend mode.  How do I make it so that the netbook stays powered on after closing the screen?  I have tried adding acpi=off apm=off to the default grub boot option in /etc/default/grub, but this did not work.

I would like closing the laptop lid to be a no-op. How can I do that?


A company brings out a new set of $n$ collectible cards. The cards are made in equal number, so there is the same probability of any given card being in a random set. They are purchased one-by-one. Question 1: If I buy $x$ cards, on average how many unique cards $(k)$ will I have? $k$ does not need to be a whole number. Question 2: How large does x need to be that k/n is over y%? Question 3: If I buy $x$ cards, what is the probability that I have $j$ unique cards. $j$ is a whole number.  EDIT: Thank you to all who have replied! As a first time poster, it is amazing to get so many helpful responses so quickly. I have learnt that this known as the coupon collector's problem. There is a very straightforward answer to the question, "What is the expected value of x needed to complete the set on n cards" \begin{align} E[x]={}&x\sum_{i=1}^n\frac1i\;. \end{align} I am struggling to find equations as simple as this to questions 1 and 2, so will post a second edit once I have them. On question 3 "user 4" kindly gave what I think is the right answer: \begin{align} \frac{n!}{(n-j)! n^x}{x \brace j} \end{align}

What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic?


New to this, sorry for bad formatting but:  The largest know prime number is a Mersenne Prime Number, i.e. it is in the form $2^n-1$. Whilst this is big, the last known prime number before this was millions of digits shorter. Take the list $2, 3, 5, 7, 11,\cdots$ in the list $11$ is the largest (prime) number. We know all the prime numbers before $11$, though. So, a better way to ask would be as stated below:  What is the largest prime number where we know all the prime numbers before it? Doing some research, I've found that we know the first $50$ million primes or so, but I'm sure with all the computing power we humans have, that cannot be the limit.

So recently, an absurdly large prime number was found, but a lot of prime numbers less than it are still not known. I am wondering up to where we know all the primes.  I put "currently publicly known" because there is a chance that some government agency has a longer list for crypto reasons or something like that.


My visa was refused because I stated I am a student but the information provided does not demonstrate I am a student or currently enrolled in an academic institution. And it is also unclear in the information provided how I am financially supported to meet the cost of living in my country. I want to know what the refusal means and my next step I can take in applying for my visitors visa.

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 helping a friend to produce his website. He's supplied his logo and a flyer that he's used, which use the colour scheme he's opted for - green, blue and white. The specific colour values for the blue and green are: 00AEEF  79BA55  Using those colours for on-page elements has had poor results for me. I've tried to find a palette using Adobe Color CC, but can't get it to produce something using those two specific hex values. Unless I'm not using it properly, it looks like Color CC only creates schemes based on one chosen colour, rather than allowing me to specify two colours to work around. So in these circumstances, given the specific colours I've been provided, how can or what can I use to create a satisfactory colour scheme from them? Note that I'm not asking to create the same kind of/equivalent colour scheme for any other arbitrary colours. Again - this is NOT the same question as the one asked , which is asking if the calculations make sense. My question does not ask about calculations; I am asking how I can create a palette of complementing colours based on the two that I have been provided with.

I have a set of colors on a webpage where one color is the main one:  #864062 <-- main color #853f61 #925071 #541c38 #64304A #eac9d7   Now I would like to derive similar color scheme for any arbitrary main color.   My idea was to:   Convert all colors to decimal notation (r, g, b) Calculate ratio of individual components for each other color and main color Use these rates as a conversion matrix for any other main color.   For my example, rgb of individual colors is:  134  64  98 133  63  97 146  80 113 84   28  56 100  48  74 234 201 215   Ratio of each component (other color / main color):  0.99 0.98 0.99 1.09 1.25 1.15 0.63 0.44 0.57 0.75 0.75 0.76 1.75 3.14 2.19   Now for any new main color I can calculate all the other colors:  100 100 100 <-- new main color  99  98  99 109 125 115  63  44  57  75  75  76 175 255 219 (max is 255, cannot have 314)   My question is if this way of calculation makes any sense as I have never done any math with colors before.


I know that this is a cauchy sequence. But I am interested in what I wrote in line 8 to 12. I was wondering if it was correct at all? I am trying to learn the bounded sequences proof We assume that the terms of a sequence ${S_n}$ satisfy this property $\forall n$ $$|a_{n+1}-a_n| \leq \Big| \frac{1}{2^n} \Big| $$ Now I would like to show that $\{a_n\}$ converges. Specifically towards $0$ As $ \ n \longrightarrow \infty \ \text{,  we have }  \dfrac{1}{2^n} \longrightarrow 0$ Also $|a_{n+1}-a_n| \geq 0$ So we have, as $ \  n \longrightarrow \infty$ $$\text{(line 8) }\hspace{1cm} 0 \leq |a_{n+1}-a_n|  \leq 0$$ $$\implies \hspace{1.2cm} \ 0 \leq |a_n - a_{n+1}|  \leq 0$$ by triangle ineq. $$\implies \hspace{1.2cm} 0 \leq |a_n| - |a_{n+1}|  \leq 0 $$ $$\text{(line 12) } \implies \hspace{0.2cm} \ 0 \hspace{.2cm} \leq \hspace{.2cm}|a_n| \hspace{.2cm} \leq \hspace{.2cm}0$$ Can I use this to say that this sequence is bounded and thus converge to $0$ Note: To be honest, I feel this is correct but I am not satisfied with the argument.

Let $s_n$ be a sequence and prove that it is a Cauchy sequence for $|s_{n+1}-s_n|\lt2^{-n}$  I'm not sure how to start doing this, but here's what I tried to do so based on the Cauchy sequence theorem I think i have to find an $N$ such that $n,\ n+1>N\implies |s_{n+1}-s_n|\lt2^{-n}$ but from the hypothesis it seems to be saying that all $n$ and its previous or $n-1$ are greater than $N$ and i don't think that gets me anywhere. I know there are similar posts for this problem, but i don't understand their solutions or how they approached the problem.


what is the meaning of it in the following sentence:      These feelings are, in all likelihood, the primordial constituents of mind, based on direct signaling from the body proper.

Right now I can only think of one instance in which this regularly occurs.  The adjective proper is sometimes placed after the noun it modifies, e.g:      A class of cold-blooded oviparous or ovoviviparous vertebrated animals whose skin is covered with scales or scutes; the reptiles proper.   What is this word order called, and why is it ever used?  Edit: I really want to know about proper, and while the word hyperbaton relates to post-positivity when it is meant to be rhetorically impacting, it doesn't seem to fit with ubiquitous post-positivity, such as that of proper.  I've accepted hyperbaton as the correct term/reason for almost all post-positive constructions, but I'd like a complete answer to include proper.


I realize that the guide for  create a List with Recycler View     In the part ViewHolder,they are using "public MyViewHolder (TextView textView)"  But when I look at another example,they are using "MyViewHolder(View itemView)"  Is there any different?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


I have been looking this up and watching videos on it for a week now. Nothing has helped! Please, does anyone know how I can do it?

I'm trying to build a teleporter. I want the player to be teleported from the first sign(left) to the right sign(right). So, when the player steps on the red wool on the left, he will automatically be teleported to the red wool on the right. I do not want to use any pressure plats.It might work with the testfor comment, but I didn't figure out, put that only works with a radius. BTW I'm in 1.10.2 bou I could probably change the version if necessary.     The testfor command block should activate the teleport command block,when the player is detected. Now, I'm not really the expert, so I know non of the commands that you would need to build this construction. Please help, I would highly appreciate it! If you need any more details, ask me!


Can I use 'or' twice in this sentence?     I don’t know whether it was a last-minute programme or they didn’t get information about the programme or the school did not get to inform the parents on time.   Or should I write     I don’t know whether it was a last-minute programme, they didn’t get information about the programme or the school did not get to inform the parents on time.

For an example is it correct to say:      You may use X or Y or Z or even something else.   And what is proper punctuation for such example in case it is valid.


To whom should I address the letter? To who should I address the letter?  Which one is correct or which one do you use?

Many times, I've been asked the difference between "who" and "whom". I myself know the difference, but it is hard to explain to others. What is the easiest way to explain it to those with a basic understanding of English? A mnemonic (if possible) would help.


I am wondering if it is possible to assign different shader's based off the colours of a Texture Painted UV Map that is assigned to an object? I've seen a couple of tutorials that use the Separate RGB node to split the colours, and then assign the shaders based off the result, but i was unsure if there was a simpler setup that followed a rule of 'if UV mapped texture = certain colour, assign this shader', possibly involving a ColorRamp node, for example?  Here is my progress so far:  Essentially each colour on the sphere would have a different shader assigned to it.  Thanks!

I'm trying to work out a way to generate a mask based on a color ID texture in the material editor (not the compositor). What I'm trying to achieve is have a node group I can re-use which has two parameters, the first parameter is the color ID texture and the second parameter is the color from the texture I want to generate a mask from.  I've included an illustration:   I got it working for some colors (such as red, green, or blue) but it didn't work in all cases, I also had a problem where the mask would show up properly when previewing it through an emissive shader but wouldn't show up when viewed through a normal diffuse shader.  Thank you for your time.


Can anyone recommend some tips for the SEO of real estate website.The competition is really high so how to make your website an authority website to make it SEO friendly.

What are the best ways to improve a site's position in the Google search results?


Can I book a tatkal ticket in Indian Railways online ?  Is yes when can it be booked?  Or is it that only premium tatkal tickets can be booked online?  Please help .Its urgent

What is the difference between a tatkal and premium tatkal ticket in Indian Railways?  I wanted a book a ticket in tatkal but it shows already the tickets are in waiting list. How is that possible?  Also how to know in advance whether a tatkal or a premium tatkal ticket is available for a particular train or not?


Wow, my first question here :) Recently i watched a tennis match and the commentator said "This is his very first title". I've also heard the opposite expression "This is his very last chance". So why is word very used and how it strengthens the meaning of the next word if not the whole sentence? :)

I have the sentence:     Who wrote the very first dictionary ever?   Is it any different from     Who wrote the first dictionary ever?   I don't get how something could be more first.


Let a and b be positive integers. If c = gcd(a,b), prove that gcd(a/c,b/c) = 1  *Note that a/c and b/c are integers.  So I know that c|a and c|b and that a gcd of 1 implies that the resulting integers are relatively prime. I know this must be within a simple definition, however I am new to these type of proofs and I don't know how to start or conceptualize this one. Any help would be appreciated.

Im trying to prove that, given $a,b$ with at least one of $a,b \neq 0$, $$ \gcd\left(\frac{a}{\gcd(a,b)},\frac{b}{\gcd(a,b)}\right)=1 $$ I have tried to prove the identity  $$ \gcd(c\cdot a, c\cdot b) = c\cdot \gcd(a,b) $$ with $c =  \dfrac{1}{\gcd(a,b)}$  However I'm having trouble understanding the proof.  Thank you for your time.


$$\int_{-\infty }^{\infty } \frac{\sin (\pi  a t)    \sin (\pi  b t)}{t^2} \, dt = \pi ^2 b$$  if $a$ and $b$ positive and $a>b$ (from Mathematica).  How is this result only based on the smaller of the two numbers, seems a very strange result. Any guidance?

Recently I found a claim saying that  $$  \int_0^\infty \left( \frac{\sin ax}{x}\right)\left( \frac{\sin bx}{x}\right) \mathrm{d}x= \pi \min(a,b)/2  $$ from what I can see this seems to be true. I already know that $\int_{0}^\infty \operatorname{sinc}xy\,\mathrm{d}y = \pi/2$, and so independant of $y$. My suspicion is that this is closely related to the integral above.   Can someone give me some suggestions for evaluating the integral above? Also are there any generalizations for the integral? Eg $$ \int_{0}^{\infty} \left( \prod_{k=1}^N \frac{\sin (a_k \cdot x)}{x} \right) \,\mathrm{d}x $$ Where $a_k, \cdots, a_N$ are arbitrary positive constants. It seems related to the , but there are some subtle differences.


I am a 17-year-old and am traveling to Germany later this year from South Africa. My German passport and my South African passport have different surnames. Will there be any problems in my travels and, if so, how do I overcome this issue?

I have an EU passport (German) in my married name and a South African Passport in my maiden name. I have applied for a new SA passport, but will not receive it in time for my intended trip to SA in Feb. I will book my ticket in my married name and use my German passport for ticketing. Will I encounter any problems with this as I have to enter SA on my SA passport (in maiden name)? I am worried as SA immigration would presumably be sent my EU passport details in advance of my arrival in SA.


So I came across this picture on facebook   My logic says it should show 200N, because you are pulling it with 100N on each side. On the other hand (as one of the facebook comments also stated, also saying is he is wrong he wasted 20k$ on physics degree), if you replace the right side with a wall you get this situation:    In this case I guess everyone agrees that the dynamometer would show 100N force. But if you isolate the dynamometer and "cut" the ropes on either picture, you would get the same thing. Because the system needs to be balanced, there would be 100N on each side.    And I study engineering too but I am confused by this. Why do we get the same distribution of forces, but dynamometer shows a different force?

I'm going to provide my argument for why I think the tension in a rope should be twice the force exerted on either side of it.  First, let's consider a different example. Say, there is a person named A and a block in space. A pushes on the block with a force of 100 N. Then, the block will also push A with a force of 100 N by Newton's third law. Now, consider the case where instead of the block, there is a person B who is also pushing on A with a force of 100 N while A is pushing on him. A will experience a force of 100 N because he pushed on B, AND another 100 N because he is being pushed by B. Hence he will experience a force of 200 N. Similarly, B also experiences 200 N of force.  Now, back to the original problem. There are two people A and B in space with a taut rope (no tension currently) in between them. If only A is pulling and B is not, then I agree that the tension is equal to the force A exerts. This situation (in my opinion) becomes analogous to the above if B is also pulling. So, say both of them pull from either side with a force of 100 N. Then the rope at the end of B will pull B with a force of 100 N (this pull is caused by A). By Newton's third law, the rope will experience a pull of 100 N. But B is also pulling his end of the rope with 100 N. Therefore, the tension should be 200 N. Similarly, the end of the rope at A must pull A with 100 N of force (because B is pulling from the other side) and hence experience a force of 100 N itself by Newton's third law plus another 100 N because A is pulling on the rope.  Apparently, the answer is not this (according to my searching on the web). So, could anyone tell me why this reasoning is wrong? Thanks.  EDIT : So apparently people don't agree with my first example, leave alone the second. This is to the downvoters and the upvoters of the highest-rated answer: You all agree that if only A pushes B with a force of 100 N, then A and B both will get pushed by a force of 100 N in opposite directions, right? Then, in the case where B is also pushing with a force of 100 N, it doesn't make sense that the answer would be exactly the same. It doesn't seem right that no matter what B does, B and A will always experience the same force as they would have if B hadn't applied any force.  EDIT 2 : I'm going to provide here a link to a question that I posted:  According to the answer and the comments there, the reason as to why my first example is incorrect is different to the one provided here. So maybe you should all read the answer and the comments provided by the person and reconsider what you think.


I am  a student in China learning American English.  I have listened to some videos and found it hard to distinguish can from can’t.  I am looking for some advice that may help me.

As a non-native speaker, I feel that it is ridiculous that can and can't could sound so similar in American accent.  Just now, I was just listening to a video in which the speaker with an American accent says     Fat cells can't reproduce themselves.   The speaker dragged the word "can't" longer for emphasis, but perhaps as a result, what I heard at first was     Fat cells can reproduce themselves.   Of course from the context I later figured out what he was really saying, but I felt extremely surprised by how these two words which literally mean the opposite could sound so similar in American accent. How is that not affecting American people's daily conversations? As a non-native speaker, is there a way for me to further clarify them when my listeners are confused? (Like when you say "one-eight" to clarify that you were trying to say "eighteen" as opposed to "eighty".)


Output is same, and it always echos need to pull. If I remove the quotes around $text in if condition it throws the too many arguments error.   var="$(git status -uno)" &&   text="On branch master Your branch is up-to-date with 'origin/master'. nothing to commit (use -u to show untracked files)";   echo  $var;  echo  $text;  if [ "$var" = "$text" ]; then     echo "Up-to-date" else     echo "need to pull" fi

I have a string in Bash: string="My string"  How can I test if it contains another string? if [ $string ?? 'foo' ]; then   echo "It's there!" fi  Where ?? is my unknown operator. Do I use echo and grep? if echo "$string" | grep 'foo'; then   echo "It's there!" fi  That looks a bit clumsy.


A scheme $X$ is separated if the canonical morphism $X\rightarrow\operatorname{Spec}\mathbb{Z}$ is separated.  Is it true that if $X$ is separated, then every morphism $X\rightarrow Y$ is separated?   Apologies if this is obviously true or false; being new to schemes I have little intuition how to prove such a thing or how to construct a counterexample.

How is it connected that scheme $X$ is separated over $Y$ and over $\operatorname{Spec} \mathbb{Z}$, where $X \rightarrow Y$ is some scheme morphism?


I just got the following message in the achievements list on the  (100% reproducible):        It seems the subdomain is stripped from links on stackexchange.com - the link should be , not . The latter results in a 404 error.

While at Judaism.SE, I recently clicked on the Achievements item and saw that I received the "acceess to moderator tools" privelege at CodeGolf.SE. When I clicked on that tab, I was taken to . This was confusing because I don't have that privilege at J.SE, and because the thresholds for the privilege on the sites are different (because CG.SE is in beta and has a lower threshold).


I am reading some notes about how to compare equality between String in Java.   String s1 = new String("abc"); String s2 = new String("abc");   These two are allocated in different memory, so their reference are different.  When we call   if (s1 == s2){ .. } // Comparing the reference, so return false if(s1.equal(s2)){..} // Comparing content, so return true   So, what is  String s3 = "abc" String s4 = "abc"?  How is the memory allocated and when I do different equality check, what will happen?   For example :  s3==s4 s3.equal(s4) s3.equal(s1)

I'm a C++ guy learning Java. I'm reading Effective Java and something confused me. It says never to write code like this:  String s = new String("silly");   Because it creates unnecessary String objects. But instead it should be written like this:  String s = "No longer silly";   Ok fine so far...However, given this class:  public final class CaseInsensitiveString {     private String s;     public CaseInsensitiveString(String s) {         if (s == null) {             throw new NullPointerException();         }         this.s = s;     }     :     : }  CaseInsensitiveString cis = new CaseInsensitiveString("Polish"); String s = "polish";    Why is the first statement ok? Shouldn't it be   CaseInsensitiveString cis = "Polish"; How do I make CaseInsensitiveString behave like String so the above statement is OK (with and without extending String)? What is it about String that makes it OK to just be able to pass it a literal like that? From my understanding there is no "copy constructor" concept in Java?


This glitch is really annoying me and I'm not sure how to fix it. I am making a character with no current textures or materials and I've been trying everything to fix it. I am using blender 2.76. I have provided pictures below. It looks prominent in Rendered and Material shading mode. It looks fine in Solid shading mode. It is also prominent when applying a Subdivision Surface modifier (which I am going to do later on anyway).  Thanks in advance.      This is the rendered view:

While rendering a mesh with smooth shading on, I get a dark region/shadow on certain faces. The effect is more evident when smooth shading is applied to a mesh containing ngons, with the ngons turning black when rendered.   The blackening effect is visible in the viewport too.  How can I solve this problem?


I've managed to set up a binary tree and can print the contents as it inserts the nodes. However, when I use a method to traverse the tree, I can create a traversal, producing multiple single arrayLists, but when I try to populate a single arrayList with the traversal I get a NullPointerException and I'm not sure why.  The original that works.      @Override public List<T> traverse() {      List<T> traversal = new ArrayList<T>();      populateTraversalList(this,traversal);      if (this.isEmpty()) {         return null;      } else {         traversal.add(this.getValue());         root.getLeft().traverse();         root.getRight().traverse();     }      System.out.println(traversal.toString());      return traversal; }   Produces the output. When given an Integer binary tree produced from an array of {0, 1, 2, 4 , 3, 5, 6, 7}.  [3] [7] [6] [5] [4] [2] [1] [0]   But when I try to neaten it up it gets nullptrs.   @Override public List<T> traverse() {      List<T> traversal = new ArrayList<T>();      populateTraversalList(this,traversal);      System.out.println(traversal.toString());      return traversal; }  private void populateTraversalList(BinaryTree<T> searchTree, List<T> traversalList) {     if (this.isEmpty()) {         return;     } else {         traversalList.add(getValue());         populateTraversalList((BinaryTree<T>) searchTree.getLeft(), traversalList);         populateTraversalList((BinaryTree<T>) searchTree.getRight(), traversalList);      } }   It seems to specifically object to the searchTree.getLeft() line, but from my understanding I should be passing on the same instance into the first parameter. Thank you in advance.

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?


So, i've been having problems for the load fonts, some text (not all) is goes with symbols appear the fonts

I'm new to use Ubuntu and need to use Microsoft TTF fonts with LibreOffice. Can anyone guide me how to do this using command line? I have already downloaded desired TTF file on my Ubuntu desktop.


Hey Im new in blender and I'm having what appears to be a simple problem, why cant I dissolve this edge? I made a plane and I loop cut it to make the hole in the middle I dissolved the other edges except for these two

How do I remove/dissolve the selected edges while keeping the geometry? Every other modeling software I've worked with can do this without any problem but Blender refuses to dissolve/remove them or adds faces if I merge them.


The electric field due to a infinite plane sheet of charge is given by $\sigma/\epsilon_o$. Now could we have deduced by symmetry that the electric field's magnitude won't depend on distance?

In the comments to this , it was hinted that proving that the force acting on a charge at a vertical distance from a uniformly charged plane is independent of that distance can be done by recalling the scale invariance symmetry. Can someone explain that to me?


I'm the owner of iPhone 4. Is there any possible way to downgrade from 7.02 to one of the previous firmware versions? The whole point is I don't have and have never had SHSH blobs and have never jailbroken my phone. The ideal is to get back to iOS 4, but even 5 and 6 would be fast enough for not annoying me all the time with iOS 7's incredible slowness. If there is some way to do that I will be absolutely happy. Thanks.

I'm trying to downgrade my iPhone from the current iOS to an older one, as per .  But every time I try, I always receive this error:     The iPhone could not be restored. This device isn't eligible for the requested build.     I have tried many times with and without DFU mode. Any ideas regarding this?


Let us consider the random vector $X=[X_1,X_2,X_3]$, which follows a multivariate normal distribution. That is, for each entry $X_i$: $X_i \sim N(\mu_i, \Sigma_i)$.  What I am trying to compute is the expectation $\mu_{X_2|X_1, X_3}$ and covariance matrix  $\Sigma_{X_2|X_1, X_3}$ of $P(X_2|X_1, X_3)$.  I've seen some very nice posts and answers on how to compute the conditional expectation and covariance matrix of $P(X_1|X_2, X_3)$ () and $P(X_3|X_1, X_2)$, but not for $P(X_2|X_1, X_3)$.  Am I missing something? It would be great to have some insights or references on what happens when we look at conditional expectations of the middle entries of a random vector!

I have a three-dimensional random vector $Y$ ~ $N(\mu , \Sigma)$ whose moment-generating function is:  $M_Y(t_1,t_2,t_3)=exp(2t_1+3t_2-3t_3+4t_1^2+5t_2^2+3t_3^2-t_1t_2+2t_1t_3)$.  It was easy to calculate $\mu$  because $M_Y(t)=exp(\mu^Tt+\frac12 t^T\Sigma t), \mu_1 = 2, \mu_2 = 3, \mu_1 = -3.$  Also, $\Sigma=\left[\matrix{8&-1&2 \\ -1&10&0 \\ 2&0&6}\right]$. (If there was any wrong points in this calculation, please let me know).  This is what I have done now....  However, I know only how to calculate the conditional mean when the vector is two-dimentional: $E[Y_1|Y_2=y_2]=E[Y_1]+\Sigma_{12}\Sigma_{22}^{-1}(y_2-\mu_2)$  $VAR[Y_1|Y_2=y_2]=\Sigma_{11}-\Sigma_{12}\Sigma_{22}^{-1}\Sigma_{21}$ (* May anyone let me know the process of having the inverse of covariance in the $\Sigma$?)  For 3D, I still did not get good idea how to calculate $E[Y_1|Y_2=y_2, Y_3=y_3] $ and $VAR[Y_1|Y_2=y_2, Y_3=y_3]$.  For example: $E[Y_1|Y_2=\frac72, Y_3=-2] $ and $VAR[Y_1|Y_2=\frac72, Y_3=-2]$. How is the process changing compared to a 2D one, and where should I start?


How many five-digit numbers can be formed using digits $1,2,3,4,5,6$ which are divisible by $3$ and $5$, without any of the digits repeating? A number is divisible by $5$ if and only if last digit is $0$ or $5$ and; divisible by $3$ if and only if the sum of the digits add to a multiple of $3$ ($3,6,9,12,15,18,21$). Divisible by $5$ means last digit is $5$. That's the only option. Divisible by $3$ means that the sum of the digits add up to a multiple of $3$. What can we do next? It's difficult for me to find the 5-tuples just by looking at the given digits? What can I do to systematize them and not miss some?

How many five-digit numbers can be formed using digits $0, 1, 2, 6, 7, 8$ and $9$ which are divisible by $3$ and $5$, without any of the digits repeating? For the number to be divisible by $5$ it must end with $0$ (or $5$, but we don't have it in the given problem). So we have $V_6^4$ numbers which are divisible by $5$ but how can we exclude those which aren't divisible by $3$?   $120$


My chain fell of and got stuck a few days ago (i ride fixed gear) and made a real mess of my back rim.  I noticed 2 marks on the brake edge of the rim where the chain scraped along. they are not very deep (under 1mm) and 1-2cm long.  Is there any way i can make the rim brakable again, without having to change my brake pads once a week? Since the incident i haven't been using the back brake because of this...

somehow the alloy braking surface of my rear wheel's rim has got a series of quite shallow lacerations, less than a mil' deep bunched quite closely together (the effected area is no more than 1/8 of the rim).  When I brake (side pull road bike brakes) I can hear it making a different sound on each rotation has the damage goes past the pads.  The wheels are Reparto Corse's which came with my Bianchi, they are new and have less than 1k miles (probably way less). And they are fine in every other respect.  So I guess my options are:   Leave it and let it smooth out with use. May take some time and wear down brake pads faster. Lightly sand the worst offending parts with high grit abrasive paper. Fill the damage with expoxy (or similar) then sand. Replace the rim (would it worth the labour cost?)   So are any of these good options or do you have any idea what you may also do?  Thanks


So I type my password incorrectly from time to time. Sometimes for sudo sometimes for logging in to my (Ubuntu) machine.  In either case, there is a two or three second delay before it gives me a second chance.  I understand that this is a security feature, but I'm curious if this could be disabled for the first failed attempt.

I notice a weird (well, according to me) thing about passwords. For example, if I type an incorrect password during login, there will be a few seconds' delay before the system tells me so. When I try to sudo with a wrong password I would also have to wait before the shell says "Sorry, try again".  I wonder why it takes so long to "recognize" an incorrect password? This has been seen on several distributions I use (and even OSX), so I think it's not a distribution specific thing.


How can I select a row in MySQL db where the value of a column contains ' and \ ?  For example, I want to select a column that matches this types of string:     \'s-disease/symptoms-causes/syc-20351556   What can I do to achieve what I want?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


$$2 = 5-3 \\ 4 = 7-3 \\ 6 = 11-5 \\ 8 = 19-11 \\ 10 = 13-3 \\ \vdots$$  For every positive even number $n$, does there always exist a pair of prime $(p,q)$ such that $p-q =n$?

Can every even integer be expressed as the difference of two primes? If so, is there any elementary proof?


As many of you know, Steam now offers a profile level system. Upon leveling up, you seem to receive rewards (eg ability to receive cards from voting on Community Choice, more friends).   As far as we know, what are these rewards, per level? Are there any rewards other than more friend slots? I know that each level gives five more friends, and 10-level milestones grant higher booster pack drop rates (20% more each milestone up to fifty).

As you can see my Steam profile says I'm level 20:    What exactly do levels do? Do they provide any sort of benefits? I've noticed the following as well:    Some of the other users  have different colored circles around their levels. Do they get additional benefits that other lower levels don't get?


By continuity of $f$, I understand that $f^{-1}X$ must be open in $Y$. Well, the statement is general, i.e. for any space $Y$. Don't know what's in it, don't know what topology it has.  Regardless, $f:Y \to X$ is continuous as long as $X=\{0,1\}$ has the indiscrete topology $\{\phi, X\}$. Why?  As mentioned we don't know what topology $Y$ has thereby, we don't know what sets are open closed or clopen or neither. So th pre-image $f^{-1}X$ has no means to be determined whether it is or isn't or neither open in $Y$ or not.  I mean, what if $f$ isn't injective and is constant, say it maps $f(y)=0 \in X$? But $0$ isn't open or closed to start with because $\{0\} \not\in \tau$. Then what? It makes no sense then to talk about whether the pre-image of open sets are open sets because $f$ isn't mapping any $y$ to an open set in $X$!   Confused, can someone tell me what is going on?

Show that if $Y$ is a topological space, then every map $f:Y \rightarrow X$ is continuous when $X$ has the indiscrete topology.  Proof:  Assume $X$ has the indiscrete topology, $T=\{\varnothing,X\}$.  $f$ is continuous if $f^{-1}(V)$ is an open subset of $X$ whenever $V$ is an open subset of $Y$.  Let $V$ be an open subset of $Y$.  I dont know how to use this to show $f^{-1}(V)$ is an open subset of $X$.


I am trying to implement listener program in which i get an HTTP status 500 Error once i submit with the index.html form page which redirect it to Servlet1 class.!  Mylistener.java  import javax.servlet.annotation.WebListener; import javax.servlet.*; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener;   @WebListener public class Mylistener implements HttpSessionListener {    static int total=0, current=0;   ServletContext ctx=null;     public void sessionCreated(HttpSessionEvent e)  {          total++;         current++;        ctx=e.getSession().getServletContext();        ctx.setAttribute("total users",total);        ctx.setAttribute("looged users",current);      }      /**      * @see HttpSessionListener#sessionDestroyed(HttpSessionEvent)      */     public void sessionDestroyed(HttpSessionEvent e)  {           current--;            ctx.setAttribute("currentusers",current);       }  }   ![enter image description here][1  Servlet1.java  import java.io.*; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.*; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession;   public class Servlet1 extends HttpServlet {        protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {         res.setContentType("Text/html");         PrintWriter out=res.getWriter();         String n= req.getParameter("nname");         System.out.println("Welcome"+n);         HttpSession session=req.getSession();           session.setAttribute("uname",n);           ServletContext ctx= getServletContext();         int i=(Integer)ctx.getAttribute("total");         int c=(Integer)ctx.getAttribute("current");         out.println("total users"+i);         out.println("Current users"+c);           out.close();     }  }   index.html  <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> </head> <body> <form action="servlet1" method="post"> Enter your name <input type="text" name="nname"><br> Enter your password : <input type="password" name="npass"> <input type="submit" value="submit"> </form>  </body> </html>   web.xml  <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5"      xmlns="http://java.sun.com/xml/ns/javaee"      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">    <listener>   <listener-class>Mylistener</listener-class>   </listener>    <servlet>      <servlet-name>First</servlet-name>     <servlet-class>Servlet1</servlet-class>   </servlet>     <servlet-mapping>     <servlet-name>First</servlet-name>     <url-pattern>/servlet1</url-pattern>   </servlet-mapping>   </web-app>     ]  Error:  HTTP Status 500 -    type Exception report  message   description The server encountered an internal error that prevented it from fulfilling this request.  exception  java.lang.NullPointerException     Servlet1.doPost(Servlet1.java:25)     javax.servlet.http.HttpServlet.service(HttpServlet.java:646)     javax.servlet.http.HttpServlet.service(HttpServlet.java:727)     org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)   note The full stack trace of the root cause is available in the Apache Tomcat/7.0.59 logs.

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?


login   I've seen such anchor tag's href property having javascript:void(0) value many times. I don't know what exactly that means.I saw this when working with angular 5. Why is javascript:void(0) used as a value for href property?

The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?    function myJsFunc() {     alert("myJsFunc"); } Run JavaScript Code     or    function myJsFunc() {     alert("myJsFunc"); }  Run JavaScript Code


I don't know how to prove the problem even when $f(x)$ is continuous. Maybe the problem forgets to add the condition.

Consider $x''+a(t)x=0$ that $a(t)$ is continuous an differentiable , if $a(t)$ is monotonic such that $a(t)\to \infty$ then all solution is bounded!


I am attempting to upgrade to the most recent Ubuntu OS but i am being stopped with warning that mfc6490cwlpr:i386 is in a very bad inconsistent state. the warning suggests that I should reinstall before I remove this pkg.  The following is my attempt to do so.  dpkg: warning: overriding problem because --force enabled:  Package is in a very bad inconsistent state - you should  reinstall it before attempting a removal. (Reading database ... 284218 files and directories currently installed.) Removing mfc6490cwlpr:i386 ... start: Unknown job: lpd dpkg: error processing mfc6490cwlpr:i386 (--remove):  subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing:  mfc6490cwlpr:i386 me@mycomp-Studio-1737:~$ ^C kingston@kingston-Studio-1737:~$ sudo dpkg --configure -a [sudo] password for ME:  dpkg: dependency problems prevent configuration of mfc6490cwcupswrapper:i386:  mfc6490cwcupswrapper:i386 depends on mfc6490cwlpr; however:   Package mfc6490cwlpr:i386 is not installed. dpkg: error processing mfc6490cwcupswrapper:i386 (--configure):  dependency problems - leaving unconfigured Errors were encountered while processing:  mfc6490cwcupswrapper:i386 me@mycomp-Studio-1737:~$ sudo apt-get install mfc6490cwcupswrapper:i386 Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package mfc6490cwcupswrapper:i386   Needless to say... I have had no luck.  Can anyone guide me through this?

I can't update my system because it freezes while installing a third-party update (zramswap-enabler)! Sometimes I get the following message in Update manager:  Could not initialize the package information An unresolvable problem occurred while initializing the package information. Please report this bug against the 'update-manager' package and include the following error message: E:The package zramswap-enabler needs to be reinstalled, but I can't find an archive for it.  I tried to remove the zramswap-enabler, but it's impossible because I get the following message: dpkg: error processing zramswap-enabler (--remove):  Package is in a very bad inconsistent state - you should  reinstall it before attempting a removal. Errors were encountered while processing:  zramswap-enabler E: Sub-process /usr/bin/dpkg returned an error code (1)  Actually I would really reinstall that package, but it is unable to do it! If I remove this third-party PPA then the system is warning me about a very very serious problem. So why can I not install/reinstall/remove/update this package and why freezes the updater if I try to update?


I'm trying to find a way to reference a cell from another sheet using a value in another cell from the "home sheet." I've tried to use INDIRECT but I'm not quite sure how to use it when the cell I'm trying to reference is from another sheet. For example: Let's say that I have two sheets, Sheet1 and Sheet2. Cell B30 of Sheet2 contains data I want to be referenced in cell A2 of Sheet1. In Sheet1, the cell A1 contains the number 30. So in cell A2 of Sheet1, I want to reference cell Sheet2!B<the number that is in Sheet1!A1>. Does anyone know how I can go about this, if I can at all? As mentioned I tried using INDIRECT but not exactly sure if this works if the cell referenced is from another sheet.

The usual way to reference a sheet is  but how do you reference a sheet when the sheet's name is a value in a cell?  For example,   A1 = "Sheet number two" B1 = A1&"!B4"   Here I want B1 to display the value in 'Sheet number two'!B4 but it's not working for me.  Any ideas?


I have made a virtual installation of Ubuntu64bit via VMWare Workstation 16, then I wanted to install KDE Plasma so I searched on the Ubuntu Software app but I couldn't find the KDE. I also tried to download directly from Mozilla and get the ISO but I don't have any sofware to read the ISO on Ubuntu. What should I do to find KDE? Thanks for the help ^^

I want to have both KDE and Gnome shells on Ubuntu. Ubuntu only has Gnome installed by default. How do I install KDE?


I'm trying to install Windows 10 Technical Preview on Microsoft Virutal PC 2007 SP1.  When I start it up to the windows logo for the restart it says:

I'm trying to install Windows 8 on my pc via Microsoft Virtual PC.  However I get this annoying, non-descriptive error:    I'm looking to find out if Microsoft Virtual PC supports Windows 8, and if so how do I solve this issue?  NOTE: I'm NOT trying to ask for alternatives to Virtual PC, but rather trying to figure out if it's possible, and if so how, to use Virtual PC.


I'm trying to convert a python script to work in Blender 2.8   I've made the changes to line 27 to say  "blender": (2, 80, 0),  but I'm getting errors in line 384 in addon_utils.py which this file doesn't exist on my system (I have 2.79 and 2.80 snap blender Ubuntu 18.04 64bit neither have this file).   and I'm getting errors in line 1480 in attractor.py  def register():   bpy.utils.register_module(__name__)   bpy.types.INFO_MT_curve_add.append(menu_func)

Can you please tell me how to remake it for Blender 2.8x version?  def register():     bpy.utils.register_module(__name__)     bpy.types.INFO_MT_file_export.append(menu_func_export) def unregister():     bpy.utils.unregister_module(__name__)     bpy.types.INFO_MT_file_export.remove(menu_func_export) if __name__ == "__main__":     register()


I am working on a ticketing system for my company using Asp.net and c#. User can create a ticket and attach a few documents to it (mostly word and excel documents). I upload and save the documents in the web server in a dedicated location (i.e. C:\Attachments).   Now, when user opens a previously created ticket, I show the list of the attachments as link buttons in a Gridview. I want user to be able to open the attachment by clicking on the link button. I have achieved this in my local machine in development, but when I publish the web app into IIS Server, I don't know how to open the files saved inside the web server. How do I provide the path for the file? Should I first download the file in the client machine and then open it? Any help is much appreciated.  This is how I open the attachment in development (which is the OnClick event of the link button):  protected void OpenAttachment(object sender, EventArgs e) {    string FileName;    FileName = @"C:\Attachments\Test.docx";    Process.Start(FileName);           }

What is the best way to implement, from a web page a download action using asp.net 2.0?  Log files for a action are created in a directory called [Application Root]/Logs.  I have the full path and want to provide a button, that when clicked will download the log file from the IIS server to the users local pc.


Let $g$ be a non-negative measurable function. For $1 \leq p < \infty$, show that   $$\int g(x)^p d\mu = \int_0^\infty p t^{p-1} m_g(t) dt$$   where $\mu$ is the Lebesgue measure and we are given   $$m_g(t) = \mu\{x | g(x) > t \}.$$   Attempt  The first thing I did is show that  $$\int g(x) d\mu = \int_0^\infty  m_g(t) dt$$ by creating a suitable simple function to approximate the right hand side and showing that it in fact equals the left hand side when we take the $\sup$ over all such simple functions. In attempting to show something similar for $g(x)^p$, note that for $t_i > t_{i+1}$ $$m_{g^p}(t_i^p) - m_{g^p}(t_{i+1}^p) = m_g(t_i) - m_g(t_{i+1})$$ since $$ t_{i+1} < g(x) \leq t_i \iff t_{i+1}^p < g(x)^p \leq t_i^p.$$  However, how do we achieve the $p t^{p-1}$ term on the right-hand side?

Can I ask a homework question here?  Let $f$ be measurable and non-negative in $\mathbb R^d.$  Using Fubini's theorem, show that for $1 \leq p \lt \infty,$  $$\lVert f\rVert^p_p = \int^{\infty}_{0}pt^{p-1}\lambda(\{x:f(x)\gt t\}) \ dt.$$


I need to uninstall Ubuntu 16.04 because of problems I’m having.  Ubuntu 16.04 is installed alone on an Apple iMac Internal 1TB disk. I’m having the following major problems with Ubuntu:   Firefox goes into Script Mode when downloading files. LibreOffice Calc, entering data into cells sometimes blacks out part of the data entered. The Calculator.app keeps self-loading, it is very annoying. Today it has self-loaded 5 copies whilst using LibreOffice Writer.   Will someone please assist me?

I bought a MacBook off eBay, thinking it would have OS X on it, but it didn't. It came with Ubuntu instead. I think it is a 2006 model or a 2007 model. I want to know how to put OS X back on it as I don't like Ubuntu.


I have a function that returns a list of strings.   I can loop through that list just like it was an array.  Is there a reason I should convert it into an array before doing so?  EDIT: The reason I'm asking is because I see code online (and on SO) that manipulate/create a collection of string using List (or other types) but then call the ToArray when returning it, why?

MyClass[] array; List<MyClass> list;   What are the scenarios when one is preferable over the other? And why?


So recently I have been thinking about infinity, and one of the things that I thought of was if you were able to get a defined value for the reciprocal of a transfinite (cardinal) number. So, I plugged $\frac{1}{א_0}$ into WolframAlpha and it said the following: Why is this the case? Shouldn't this be similar to this case? $$\lim_{x\to\infty} \frac{1}{x} =0$$ Aren't $\infty$ and $א_0$ equal to the same value in this context? What am I missing here?

I have a fairly fundamental question. What is the difference between infinity as shown by the aleph numbers and the infinity we see in algebra and calculus?  Are they interchangeable/transposable in any way? For example, could you describe the infinity of a limit with an aleph number? Does it have cardinality?  Thank you.


I have read now a couple of times that the rate of false positives is upper bounded by the significance level alpha regarding hypothesis testing, and does not depend on sample size. But how so? As far as I can see, the probability of drawing only extreme values is much smaller when the sample size is 1000 than say 3..  Thanks

If I run the R code below, it will generate two independent vectors then test them to see if they are related in some way (i.e. p-value < 0.05).  If I repeat this 1,000 times, then 50 of these (5%) will have a false positive, with a p-value < 0.05. This is a type 1 error.  If we increase sampleSize to 1000, or even 100,000, the results are the same (5% false positives).  I am struggling to understand this, as I would have thought that if we collected enough samples, the chance of a false positive would drop towards 0 (just like correlation).  So, I guess my question is: "How is it possible that the number of false positives, based on p-values generated from comparing two independent datasets, be independent of sample size?".  # R code to demonstrate that with a large dataset, we can still  # get significant p-values, purely by chance.  # Change this to 1000, and we still get the same number of false positives (50, or 5%). sampleSize = 20  cat("Sample size:",sampleSize,"\n")  set.seed(1010093) n=1000 pValues <- rep(NA,n) for(i in 1:n){     y <- rnorm(sampleSize)     x <- rnorm(sampleSize)     pValues[i] <- summary(lm(y ~ x))$coeff[2,4] } # Controls false positive rate fp = sum(pValues < 0.05) cat("Out of ",n," tests, ",fp," had a p-value < 0.05, purely by by chance.\n",sep="")  ----output---- Running "true positives - none.R" ... Sample size: 1000  Out of 1000 tests, 52 had a p-value < 0.05, purely by by chance.


I just suggested an tag wiki excerpt edit on Programming Puzzles & Code Golf, and now I get this suggested edit indicator:    But because it is my own edit, I get "There are no items for you to review." So actually, I should not get this indicator.

On the new History beta site I have the privilege to approve tag edits already but my own edits still go into the review queue. And the review dashboard displays a different number of pending edits depending on where I am: on  I see one pending edit, on  I see none. I am pretty sure that the pending edit being displayed is my own - I edited a tag wiki and that edit hasn't been approved yet. It shouldn't be counted no matter where I am.


I am running a fairly current version of Kubuntu...  Kernel: 4.13.0-36-generic x86_64   bits: 64 Desktop: KDE Plasma 5.10.5   Distro: Ubuntu 17.10  In all the "KDE" distros I've used in the past I could easily run "gui" apps with elevated credentials: ie. "sudo dolphin", "kdesu dolphin", etc.  With kubuntu I cannot get any of these to work. I managed to do a cli "cp" to get some scripts moved to /usr/local/bin but I'm not a Linux tekkie so it was a real fight for me. If I can't get the apps I normally use to run "elevated" on those rare occasions when I have that need then kubuntu is not a good fit for me. Is there a way I can continue using kubuntu and do what I need to do?  Specifically: I need to run Dolphin with root privileges.  Thank you

I installed Ubuntu 17.10. Now I am having trouble with gksu:  $ gksu -dg synaptic No ask_pass set, using default! xauth: /tmp/libgksu-HgUjgQ/.Xauthority STARTUP_ID: gksu/synaptic/8760-0-alex-XPS-15-9530_TIME4974977 cmd[0]: /usr/bin/sudo cmd[1]: -H cmd[2]: -S cmd[3]: -p cmd[4]: GNOME_SUDO_PASS cmd[5]: -u cmd[6]: root cmd[7]: -- cmd[8]: synaptic buffer: -GNOME_SUDO_PASS- brute force GNOME_SUDO_PASS ended... Yeah, we're in... Unable to init server: Could not connect: Connection refused (synaptic:8767): Gtk-WARNING **: cannot open display: :1 xauth: /tmp/libgksu-HgUjgQ/.Xauthority xauth_env: (null) dir: /tmp/libgksu-HgUjgQ   If I don't use -g, the password dialog is disabled. So looks like a problem with creating a tty for root.  Any advice?


I came across  and at the time there were no suggested answers. After reading Mark Hubbart's comment (at the time with four upvotes), which was the correct answer, and seeing that it had been over 30 minutes since his comment, I figured I would provide that answer in my own words, which I did. My answer is longer, and I think more rounded and more useful, but the core of the answer came from the comment. I have no idea if I'd have thought up the answer on my own--a definite maybe to that.  Now had I tried to be "honorable" or something, such as instead of answering, suggesting to the commenter that he make his comment an answer, I would only have accomplished giving away easy rep to some other user not as into gratuitous self-denial.  The commenter had merely to enter his comment into an answer box instead of a comment box! It was his choice! Whether he was too lazy or didn't think his answer worthwhile or some other reason is not my responsibility. Must I bend over backward to help him earn points that he so carelessly left lying around for another person to take? It just took a tiny bit of non-laziness on my part to get my text typed into the box that would reward me instead of the box that wouldn't.  If my perspective is incorrect and the community would rather see such answers-as-comments rewarded and supported, I will gladly accept that. In the meantime, I just want to shake off the tiny bit of guilt my overly-nice and overly-concerned-with-propriety self is feeling. :)

I am relatively new to SO and see this very often. As the title suggests there are many questions that are answered in comments itself and they remain unanswered forever. Shouldn't there be an option to mark a comment as an answer and the comment is copied over as an answer or something like that?  I guess there should be an option to the creator of the question to do this.


I use the lib commons-lang-2.4.jar for my project. I develop under Windows, then send everything (including those libs) to Ubuntu server 4.6.3 Under windows, everything works fine. But when I launch my program under Ubuntu, I get this error:   java.lang.NoSuchMethodError: java.lang.String.join(Ljava/lang/CharSequence;[Ljava/lang/CharSequence;)Ljava/lang/String;   How can I fix it?

I'm getting a NoSuchMethodError error when running my Java program.  What's wrong and how do I fix it?


It isn't by default like that? For example:   **public** int [name]; **public** String [name];

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


In Windows, you can run android application using BlueStack.   I was wondering, is there any way these apps can be run on Ubuntu 12.04?

Basically, I have a kindle fire that uses a form of the android OS and was wondering if there was a way I could run similar apps on my Ubuntu system. Specifically I'd like the news reader program "Pulse".  Anybody know if such an emulator or workaround exists?


i'm watching  . and the answers and they're all fine but there is something that bugging me about "rounding down" i attach it below  "for $x < 0$ but sufficiently close to $0$ (e.g., $x = -0.1$), $\lfloor \sin x \rfloor$ is no longer zero, but $-1$, because you are "rounding down."  Therefore, $f(x) = x/(x+1)$"  and unfortunately people who answer this is no longer active , so can someone help me how that $rounding down" work ?

In my assignment I have to prove that the following function doesn't have a limit:  $$f(x)=\frac{x}{x-\lfloor{\sin x}\rfloor}$$ when $${x \to 0}$$  In other words, I have to prove that for every $\delta$ such that $0<|x-{x_0}|<\delta,$ $|f(x)-L|>\epsilon$.  In fact, I don't even know how to start. Do I choose my $\delta$? I know that the sin function has certain values that's supposed to help me. How do I use it?  I have to prove this by definition, so I can't use limit arithmetic for example  Thanks.


I created a rectangle array to store my snake body. In the grow method, I create a local ArrayList and initialize it, adding the content of the rectangle array. Then I try to add new rectangle to the ArrayList, however at this point, I receive NullPointerException, and I'm not sure why and how to fix it. I've tried searching it up on google and on this website, however I did not find a topic with this problem.  public class Snake extends GameObject {     private Rectangle[] snake;     private int speed;      public Snake(int locX, int locY, int width, int height, int speed, ID id)      {         super(locX, locY, width, height, id);         snake = new Rectangle[3];         snake[0] = new Rectangle(locX, locY, width, height);         this.speed = speed;         grow();     }      public void render(Graphics g)      {         g.setColor(Color.GREEN);         drawSnake(g);                    }         public Rectangle getBounds()     {         return new Rectangle(locX, locY, width, height);     }         private void drawSnake(Graphics g)     {                for(int i = 0; i < snake.length - 1; i++)         {             g.fillRect(locX, locY, width, height);         }     }      private void grow()     {         ArrayList<Rectangle> tempBody = new ArrayList<Rectangle>(Arrays.asList(snake));          tempBody.add(new Rectangle(snake[snake.length - 1].x, snake[snake.length - 1].y, width, height));             snake = tempBody.toArray(snake);     }    }

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?


(ZFC) Let X ⊆ R is a well ordered form the standart order in R. Prove that X is either finite or countable. My attempt: Since X is well ordered then if L is a chain where every countable subset of X is well-ordered, L is well ordered as well. In other words: then L contains a finite descending sequence a0 > a1 > a2 > . . . with a minimal element an, hence X is finite; If I manage to find a function which maps every element of my set into a unique ordinal I think that this is satisfying. Still I know that well-ordered set is order-isomorphic to a unique ordinal. However, I do not how to make use of it. I hope that someone will help me. Thanks!

I tried to write a formal proof for the theorem: $A$ subset of $\mathbb R$ well ordered by the normal order $\implies A$ is at most of cardinality $\aleph_0$.  Any suggestions?  Thanks.


I'm doing a table with a S column type from siunitx package (I've recently started to use this package). I usually represented empty values in cells using the character ---, however, S type colum doesn't alingn correctly this symbol. Hoy can I put this symbol in the center of the column?  \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{booktabs} \usepackage{siunitx} \begin{document} \begin{table}[htb] \centering \caption{Example Table} \begin{tabular}{cS[table-format=2.3]} \midrule \textbf{Parameter} & \textbf{Value}\\ \midrule Parameter 1 & 12.56\\ Parameter 2 & 9.038\\ Parameter 3 & 12.6\\ Parameter 4 & 0.732\\ Parameter 5 & \text{---}\\ \midrule \end{tabular} \end{table} \end{document}

I'm using estout (esttab actually) to produce a table in Latex from Stata. I'm using the dcolumn package to align the decimal places in my table.   I want to override the alignment for a single row; to be specific the number of observations row. Is there a way of doing this? Or, equivalents, if there a way to prefix each element in a row with "\multicolumn{1}{c}{" and suffix with "}", which would override the dcolumn alignment?  Example:  \begin{table}[htbp]\centering \caption{My Table} \begin{tabular}{l*{3}{D{.}{.}{-1}}} \toprule                             &\multicolumn{1}{c}{Mean/s.d.}&\multicolumn{1}{c}{Mean/s.d.}&\multicolumn{1}{c}{Mean/s.d.}\\ \midrule Var A               &        8.68&        8.51&        8.92\\                     &        2.42&        2.51&        2.26\\ Var B               &        2.14&        1.98&        2.37\\                     &        1.33&        1.29&        1.35\\ \midrule Observations        &       38040&       22054&       15986\\ \bottomrule \end{tabular} \end{table}   Thanks!


Each time I use Texmaker, it creates a host of files that are not immediately useful for me (*.log, *.dvi, *.blg, *.bbl, *.gz). Is there any way to 'hide' these files? They can cause quite a clutter. Thanks!

If I create just a basic hello.tex file an compile it using   pdflatex hello.tex   The pdflatex program is creating a plethora of file which is a little annoying. Currently it writes all those files about which I really don't care:  hello.aux, hello.log, hello.nav, hello.out, hello.snm, hello.toc   Is there a way to tell pdflatex to only write hello.pdf if the build is successful ? If not, can I specify the output directory of those files ? Maybe I could just write them in /tmp.


I am starting to write my materials and methods section of my thesis. My Supervisor would rather have one chapter at a time to an extent so I was wondering if it is possible to have separate documents for each chapter with identical preamble and bibtex files attached and then just link them all up in a single latex document.   In the main latex document I would then want to auto generate the ToC in the correct format, have references work across chapters and be able to have my title page etc in main.   Is this possible or should I just write it all as one document?

I am writing a large document with several chapters and I would like to work on each chapter separately. In my main.tex I include the chapters either like   \include{chap1.tex}  \include{chap2.tex}  \include{chap3.tex}   or   \input{chap1.tex}  \input{chap2.tex}  \input{chap3.tex}   I think \include is preferable if I want things to be referenced and cited correctly? but doing it the \include way latex main.tex I don't get any dvi output whereas with \input things compile fine to dvi. What's going wrong here?  I would then like to use \includeonly (or \excludeonly ) to work on individual sections of the document whilst maintaining the referencing etc.  A mwe can be handy:  \documentclass[a4paper,10pt]{article} \includeonly{chap1}  \begin{document}   \include{chap1}   \include{chap2}   \include{chap3} \end{document}


I have this regular expression   url\s*\((?:\'|"|)((\S*|\?)(?<!\'|\"))(?=\'\)|"\)|\))   It works well for what I want in these cases:  url("../../Common/common/fonts/lato/lato-black-webfont.svg?#lato_blackregular")  But when I have a situation like this it does not work the way I want it  lato_blackregular;src:url("../../Common/common/fonts/lato/lato-black-webfont.eot");src:url("../../Common/common/fonts/lato/lato-black-webfont.eot?#iefix")  How can I define ";" such as a line break, whenever you have a ";" it for the combination and start over?  Demonstration of what is happening:   Use \S*? does not work because it stops combining correctly with background:url(/uploads/2019/03/0002-image(thumbnail_product).jpg)

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


i am a level 12 commando (heavy shock trooper) on borderlands 2. I'm on the dam fine rescue mission and need to beat w4r d3n but i can't find any corrosive weapons. i heard there are some hidden in certain chests and in shops but i can't find any. any help or corrosive weapon locations?

I'm a Siren and I'm getting almost nothing but Fire elemental guns; about 90% of guns have been fire, most of the rest Explosive and a scare few Shock.  Are the elemental varieties more common at different levels? I've seen zero corrosive/shock guns so far. I'm level 12 at the moment.


I've seen that the energy produced by breaking an oxygen atom's nucleus is equivalent to burning a LOT of coal, 4.6 million metric tons if I remember correctly. (Crash Course Chemistry)  If that is the case, why do people mine for uranium and plutonium for nuclear power plants if lighter elements can produce a tremendous amount of energy? Why can't they use nitrogen, which is abundant in the atmosphere, instead of radioactive elements?

Why do only heavy radioactive elements perform fission? I mean what's so special about heavy elements which makes them ideal for nuclear fission?  Also why do only neutrons show fission/fusion and why can't electrons preform fission/fusion?


I didn't see anything on here about my question but if this is indeed a dupe, please let me know. I figure this is a simple question but I've never chosen a separate partition for my home directory because of running out of room, I've done it for other directories which made my system feel like it had too many quotas...    All I wanna know is what are some of the benefits of installing Ubuntu with a separate /home partition?  What drives users to choose a separate partition for their home directory?  Are these benefits applicable to other linux and maybe non-linux operating systems?    Thanks!

This is not a question about how to create a home partition, just as a caveat. :)  What are the pros and cons to having a separate home partition? How do I know if having one is right for me? Will it increase or decrease speed of file retrieval? Are there any risks?


Example:     Speaker A: Thanks for the fish, I'll feed it to my crocodile.      Speaker B: Your crocodile? I (had) better not ask.   I better not ask sounds better to me ( results on Google Books). However, the one with the most results is I had better not ask ().  Which one is the most common idiom? (I'm open to other suggestions.)

English is not my native language, so I'm wondering, should I say:     I'd better go away now.   or:     I better go away now.   or even (I think I've heard this one):     I better go now.   Thanks in advance!


This is probably a very dumb question for this forum, if so I'm sorry; but from what I know it does not make sense that the CMB is still visible and measurable today.  From what I understand, the CMB dates back to a time which has been calculated at being 380,000 years after the big bang, time at which photons in the primordial "particle soup" were able to escape.  But then photons move, unrestricted, at the speed of light (save for space time curvatures and collisions) so I would expect that this batch of photons which were able to escape would be long gone by now... Yet COBE, WMAP and Planck can still trace the origins back to the CMB. And save for the precision of measurements, due to the progress of technology, they pretty much all give the same picture.  I am at a loss. Especially since between COBE and WMAP the proof that the expansion of the universe is accelerating over time has been established.  I must be missing something fundamental here; why is it that this "batch of photons" is still visible today? Or does that mean that the CMB still has a physical existence somehow?

Imagine you have a box of black body radiation. What happens if you open the box for a long time? It becomes dispersed and no radiation remains in the box.   Now, apply this example to the Cosmic Microwave Background radiation. The CMB has been produced about 380,000 years after the Big Bang. Giving that the space is flat as many observations suggest, that radiation has been produced in a universe with no boundaries.   Now, my question is this: in these conditions, why that radiation has not been dispersed completely so far? It is true that the radiation has been produced everywhere in the space but giving that the space is infinite, why has not it been dispersed do far?   Calculations in the standard textbooks are done in such a way as if the CMB has been within a physical box, however expanding with the universal expansion. But, this is not the actual situation. The CMB has not been and is not enclosed by walls of a box, so it must have completely dispersed so far. What has prevented this to happen?


I have a question connected with MS SQL. When inserting less then about 1350000 rows to the table it all takes about 2 minutes, but when number of inserted rows is bigger, then a time needed to insert data grows to about 5 hours.  The problem is not connected with query or indexes, because everything has been working fine for a long time and nothing has changed in the structure of query, tables or indexes. Problem appeared for the first time about 2 weeks ago and it appears repeatedly on days, when number of inserted rows is bigger than +-1350000. For example on one day number of ins rows is 1200000 and the process takes 2 minutes, on the other day number of rows is 1450000 and it takes 5-6 hours to insert data.  I tried to rebuild indexes, but it has not helped.  :)

When inserting less then about 1,350,000 rows to the table it all takes about 2 minutes, however when number of inserted rows is bigger, then the time needed to insert data grows to about 5 hours.  The problem is not connected with query or indexes, because everything has been working fine for a long time and nothing has changed in the structure of query, tables or indexes.   Problem appeared for the first time about 2 weeks ago and it appears repeatedly on days, when number of inserted rows is bigger than +-1,350,000. For example on one day number of inserted rows is 1,200,000 and the process takes 2 minutes, on the other day number of rows is 1,450,000 and it takes 5-6 hours to insert data.  I tried to rebuild indexes, but it has not helped.


I wanted to just confirm how much the size of Swap partition should be. Lots of places tell that the swap size should be twice the size of RAM. Somebody also told me that it shouldn't be more than 8 GB.If twice the size of RAM is more than 8 GB how big should the Swap partition be?

I'm going to install 64 bit 14.04 on a new machine with something like 1 to maybe 128GB RAM and even more RAM later. How much space should I allocate to the swap partition?   And especially: WHY those recommendations for these numbers?    (None of the existing answers  and  explain any of the why and are a bit dated if we look at 1GB or RAM and up)


I booked travel from Perth Australia (QF648 2350 11 April 2019) via Melbourne Australia to Christchurch New Zealand (QF133 0715 12 April 2019) but there was a delay in Perth. Because I was going to miss my connection in Melbourne, Qantas transferred me to Air New Zealand in Melbourne so I could travel to Christchurch via Auckland on flights NZ722 and NZ555. I think there was also some sort of delay with one or other of those flights but I'm not sure, and I got to Christchurch too late on 12 April 2019 to travel to the town where I had pre-booked accommodation so I had extra expenses in Christchurch.  I’m now trying to complete a travel insurance claim but I can’t remember all the details. Is there a free open-source list of that kind of thing? It’s not like I have to prove in the claim that the delays occurred because I would guess the insurance company is going to check that in any case; but I would like to get the details right.

The question  only deals with flights in the US sourced from the  . Is there some similar source for EU, Asia etc?


I'm curious about the notion of a minimally dense subset of a given space (I've been using $[0,1]$, but if others are interesting, I'm interested in that too!). Here are two questions.     Does there exist a set $A$ that is dense in $[0,1]$, but for all infinite $B\subset A$, $A\setminus B$ is not dense in $[0,1]$? I suspect that the answer to this question is no, but I haven't been able to prove it. I'm also curious about what modifications to this statement can create a notion of "minimally dense" subsets. For all $\alpha\in \mathbb{R}\setminus\mathbb{Q}$, there exist infinitely many rational numbers $\frac{m}{n}$ with $|\alpha-\frac{m}{n}|<\frac{1}{n^2}$. In his analysis book, Browder remarks that this theorem is a way that one can quantify density. Is there a way to use statements like this to come up with a "minimally dense" subset of [0,1]?   Let me know if there are other ways of talking about this notion, or whether you think there is something wrong with the idea of a minimally dense set in general. Thanks!

Let $X$ a space; and $Y$ is a dense subset of $X$. However there may be some subset $Z$ of $Y$ such that $Z$ is also dense in $X$. Now I want to delete some elements of $Y$ which seem needless, so that I can make the new dense subset $Z$ of $Y$ be the smallest. How can I get it?  My idea is this: If there exists $y \in \overline{Y\setminus \{y\}}$, then delete $y$, because $Y\setminus \{y\}$ is also dense in $X$. However what should I do next step?  Thanks ahead:)


I am unable to understand why my value is not storing in the stack.. UseStack.java package test; import java.util.Scanner;  class UseStack{     private static Scanner obj;     public static void main(String[] args) {         obj = new Scanner(System.in);         System.out.println("Enter the size of Stack....");         int n = obj.nextInt();         Stack stack = new Stack(n);         while(true){             System.out.println("1: Push");             System.out.println("2: Pop");             System.out.println("3: Show");             int choice = obj.nextInt();;             switch(choice){                 case 1:                 Push push = new Push(n);                 push.push();                 break;                 case 2:                 Pop pop = new Pop(n);                 pop.pop();                 break;                 case 3:                 Push push1 = new Push(n);                 push1.show();                 break;                 default:                 System.out.println("Invalid Option");                 break;             }         }     } }  Stack.java package test;      class Stack {         public int arr[];         public  int top;         public  int capacity;              public Stack(int size){             this.arr = new int[size];             capacity = size;             top = -1;         }     }  Push.java     package test;     import java.util.Scanner;          class Push extends Stack {         public Push(int size) {             super(size);         }              private static Scanner obj;         public void push(){ obj = new Scanner(System.in);             System.out.println("Enter Value to push...");             int value = obj.nextInt();             if(top==capacity-1){                 System.out.println("StackOverflow");                 return;             }             else{                 top++;                 arr[top]=value;                 System.out.println("Pushed...");             }         }        public void show(){         if(top==-1){             System.out.println("StackUnderFlow");             return;         }         else{             System.out.println("Stack Elements : ");             for(int i=top;i>=0;i--){                 System.out.println(arr[i]+" ");             }         }            } }  Pop.java package test;  class Pop extends Push{     public Pop(int size) {         super(size);     }      public void pop(){         if(top==-1){             System.out.println("StackUnderflow");             return;         }         else{             System.out.println("Poped.. "+arr[top]);             top--;         }     } }  Please execuse my ignorance for posting the whole code and there were several questions has been already asked on this topic but what should i have to do to overcome with this error... Error As i pushed two values in array and then tried to show the element , stackunderflow i got....

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?


Hello I have a simple problem using Python but I don't achieve to solve it.  Here is my problem :   a = '2020-06-15' a = a[::-2] + "01" # according to me with this a = '2020-06-01'   But when I printed a I get :  '100101' for the value of a...  Could you help me please ?  Thank you !

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I have some code that I have to study and I'm not understanding what is a unsigned int and how it works.  void print_all_sums(unsigned int n,double a[n]) { // 1 <= n <= 30    unsigned int i,j,mask;    double s;   Something like this.

Am I correct to say the difference between a signed and unsigned integer is:  Unsigned can hold a larger positive value and no negative value. Unsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is positive or negative. Signed integers can hold both positive and negative numbers.  Any other differences?


Definition 1: A set M is infinite iff there‘s some N $\subset$ M with some f: M $\to$ N bijective (|M| = |N|). Definition 2: A set M is infinite iff some g: M $\to$ M being injective but not surjective. I want to prove the equivalence of both definitions. Does anyone know/see a simple proof? I wonder if one should start by writing down both definitions as PL formulas and go from there? In the comments there is a link where you can find another link with the very proof I want but as a computer program I cannot quite understand and way too complicated. I hope for a smooth and simple proof but I do not see it. I could now see a proof from 2 to 1: Assume definition 2. Then g: M $\to$ rng(M) is bijective and because g: M $\to$ M is not surjective it means rng(M) lacks at least one element of M, so that rng(M) $\subset$ M which fullfills definition 1. Is that ok? But what with the direction from 1 to 2?

I have been using the following definition of infinity (from Dedekind): Set $S$ is infinite iff there exists a proper subset $S'$ of $S$ and bijection $f: S\rightarrow S'$. Occasionally, I have seen "injection" used instead of "bijection." Exactly why is this wrong? Can anyone give me a counterexample demonstrating why these are not equivalent definitions?  Follow-up 8 years later: See my formal proof of the equivalence using a form of natural deduction and basic set theory at:


I try to edit my TextViews from another class.  It is a RecyclerView Adapter. When I click on "delete" an server gets deleted. Also some buttons and text should get invisible on the UI.  protected MainActivity context;  public ContactsAdapter(Context context){     this.context = (MainActivity) context; }  public void onBindViewHolder(ContactsAdapter.ViewHolder viewHolder,final int position) {  ...  final Handler mHandler = new Handler();  new Thread(new Runnable() { @Override public void run () {  mHandler.post(new Runnable() { @Override public void run () { TextView commandrun = (TextView) context.findViewById(R.id.command_run);          commandrun.setVisibility(View.INVISIBLE); } }); } }).start();   Actually I get java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View com.minvercraft.minvercraftfree.MainActivity.findViewById(int)' on a null object reference.


As I was trying to cast a vote with an SE account with <15 rep, I read:  Thanks for the feedback! You need at least 15  to cast a vote, but your feedback has been recorded.   What does "your feedback has been recorded" mean when casting a vote was declined because of low rep? Does that mean the vote will be displayed only once that account reaches >= 15rep?

Users below 15 reputation can't effectively vote. It says:     Votes cast by those with less than 15 reputation are recorded, but do not change the publicly displayed post score   Does it mean that they will take effect after I reach 15 reputation or because they were cast before, they're recorded but ignored?


I could not figure out how to solve this problem. Can anyone give me a hint how to solve this: $$ \int \sqrt{1-\sin2x}dx$$

I want to solve the following integral without substitution:  $$\int{\sqrt{1-\sin2x}} \space dx$$    I have: $$\int{\sqrt{1-\sin2x}} \space dx = \int{\sqrt{1-2\sin x\cos x}} \space dx = \int{\sqrt{\sin^2x + \cos^2x -2\sin x\cos x}} \space dx$$    but this can be written in two ways: $\int{\sqrt{(\sin x - \cos x)^2}} \space dx$ or $\int{\sqrt{(\cos x - \sin x)^2} \space dx}$ and it seems to be pretty far from what the real result is:   Can I get any hints?  EDIT:  Thank you for your answers! So as you all showed, we have: $\int{\sqrt{1-\sin2x}} \space dx = \cdots = \int{\sqrt{(\sin x - \cos x)^2}} \space dx$ or $\int{\sqrt{1-\sin2x}} \space dx = \cdots = \int{\sqrt{(\cos x - \sin x)^2} \space dx} = \int{\sqrt{(-(\sin x - \cos x))^2} \space dx}$    combined: $\int{\sqrt{1-\sin2x}} \space dx = \cdots = \int{\sqrt{(\pm(\sin x - \cos x))^2} \space dx}$  so we actually have: $$\int{|\sin x - \cos x|} \space dx$$    I drew myself a trigonometric circle and if I concluded correctly, we have: 1. $\int{\sin x - \cos x} \space dx$ for $x \in [ \frac{\pi}{4} + 2k\pi , \frac{5\pi}{4} + 2k\pi ] , \space k \in \mathbb{Z}$ 2. $\int{\cos x - \sin x} \space dx$ for $x \in [ -\frac{3\pi}{4} + 2k\pi , \frac{\pi}{4} + 2k\pi ] , \space k \in \mathbb{Z}$    ... which means: 1. $x \in [ \frac{\pi}{4} + 2k\pi , \frac{5\pi}{4} + 2k\pi ] , \space k \in \mathbb{Z}$ : $$\int{\sqrt{1-\sin2x}} \space dx = \int{\sin x - \cos x} \space dx = -\cos x - \sin x + C$$ 2. $x \in [ -\frac{3\pi}{4} + 2k\pi , \frac{\pi}{4} + 2k\pi ] , \space k \in \mathbb{Z}$ : $$\int{\sqrt{1-\sin2x}} \space dx = \int{\cos x - \sin x} \space dx = \sin x + \cos x + C$$


What can be the way of simplifying polygons in ArcMap? I have a shapefile with buildings and I have to make them as simple as it's possible. I used already some tools, like: dissolve, union, generalize, integrate and even buffer. I still have something like this to remove:   Small angle between buildings makes problems with mesh generation I want to do afterwards. Any ideas how to remove it massively for all objects? I know I can increase buffer distance, but maybe there is something which will not change geometry that much.  EDIT: After using Simplify Polygon or Simplify Bulilding some areas are simplified (left side of picture) but not those I would be interested in:   And as an answer for the duplicate - my question is different, I don't want to delete overlapped lines, just remove holes which have very small angles.

Working in ArcMap, I have come across errors in a polygon layer that I will call "flag slivers" (taken from similar language in parcels call "flag lots").  These sliver polygons (see image below) are typically composed of just one additional node that user has  accidentally added.    In the images below, the "flag" and the "flagpole" are one single-part feature where the "flagpole" just overlaps itself.  The left-hand image has a total of 5 nodes.     When seen alone the errors are very obvious, but when multiple polygons are adjacent, they are nearly impossible to see because they appear to be the boundary between 2 polygons.  This likely happens because they are using a shapefile based editor, and therefore I cannot implement any topology-based editing rules to prevent this from happening in the future.  Does anyone have a way of identifying and resolving these types of errors?  I would prefer an automated method of both identification and resolution since field users are the ones who created the errors, but I am stuck cleaning up after them.  Thanks.


I'm trying to understand the classes in <random> better but I'm unsure between all the different options kind of generator would work best for something like a d20 type rolling. I also understand that rand() is considered now to be bad practice compared to the c++11 options.

I need to generate random numbers within a specified interval, [max;min].  Also, the random numbers should be uniformly distributed over the interval, not located to a particular point.  Currenly I am generating as:  for(int i=0; i<6; i++) {     DWORD random = rand()%(max-min+1) + min; }   From my tests, random numbers are generated around one point only.  Example min = 3604607; max = 7654607;   Random numbers generated:  3631594 3609293 3630000 3628441 3636376 3621404   From answers below: OK, RAND_MAX is 32767. I am on C++ Windows platform. Is there any other method to generate random numbers with a uniform distribution?


Consider the following MWE:   \documentclass[]{report} \usepackage{amsthm}  \makeatletter   \def\th@definition{   \thm@notefont{}   \bfseries} \makeatother  \newtheoremstyle{definition}{2.5em}{2.5em}{}{}{\bfseries}{}{1em}{} \theoremstyle{definition} \newtheorem*{defn}{Definition}  \begin{document}  \begin{defn}[Optional Title] Definition content. \end{defn}  \end{document}   I want to keep the updated definition style, but have the optional title in bold. The first few lines of code (makeatletter ... makeatother) accomplish this for the default definition, but they stop working when I try to modify the definition style. How can I fix this? Thanks in advance.

I use the code mentioned in :  \begin{theorem}[The title] Some statement \end{theorem}   However with amsthm the optional title -- above: "The title" -- is neither bold nor italic, but (ordinary) roman. I prefer to work with amsthm, so how can I solve the problem?    Update: After applying the code  \newtheoremstyle{mystyle}%                % Name   {}%                                     % Space above   {}%                                     % Space below   {\itshape}%                                     % Body font   {}%                                     % Indent amount   {\bfseries}%                            % Theorem head font   {.}%                                    % Punctuation after theorem head   { }%                                    % Space after theorem head, ' ', or \newline   {}%                                     % Theorem head spec (can be left empty, meaning `normal')  \theoremstyle{mystyle} \newtheorem{theorem}{Theorem}  \begin{document}  \begin{theorem}[abcd]\label{firstlabel}% 111 \end{theorem}   The output looks like this:    The content in the bracket is still not bold. How can I change it?  It can be solved by  \begin{theorem}[\bfseries abcd]\label{firstlabel}% 111 \end{theorem}   although I'd like to have it set universally.


I have windows 7 already installed and I am trying to install ubunutu using USB installer. I am unable to find available partition , i have read many forums saying i can have only 4 partition , I am attaching the screen shot of the avaialble partition , please help me. I think sd3 is not used since its just 126kb can i format and use that partition? On my windows I have three drives c d and f(which i created for ubuntu but its not shown up while installing) All my drives are shown as Simple Volume.   Is wubi Windows installer safe to try in this case

I've been trying to install 12.04 for a while now, I'm running on Windows 7 and I already made the partition (it's dynamic). I've tried booting from a disc and also the Windows installer. I haven't tried used any repair-boot programs or anything. Every time I tried to load from either, I get an error:  command=C:\windows\sysnative\bcdedit.exe /set {03f9077f-661f-11e1-845a-d08b36406c3d} device partition=U;  retval=1  stderr=An error has occured setting the element data. The request isn't supported  stdout=   Then after that, it makes a log file with information that I don't understand.  If it is simply due to the fact of it being a dynamic partition, someone please help. If it is more extensive, anyone with details on possible solutions or definite ones please express them.


I want to hatch a certain area using tikz's pattern library.  Here is what I currently have:  \begin{tikzpicture}     \draw{(0,1.5) -- ++(0, -3)};     \fill[pattern = north east lines, pattern color = black] (-1,-1.5) rectangle (0,1.5); \end{tikzpicture}     (The weird grey line is an artifact, it disappears when I zoom in).  This is how i want it to look like:    (Ignore the additional lines).  Does anybody know how i can change the spacing between the lines?  Thanks!

I have modified the north east lines pattern to accept a \LineSpace option that sets the density of the pattern (see the question ). The code works very well but I can't modify the color of the pattern using the pattern color option as I did before.  \documentclass{minimal} \usepackage{pgfplots} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{2mm} \pgfplotsset{compat=newest} \usetikzlibrary{patterns}  \pgfdeclarepatternformonly[\LineSpace]{my north east lines}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{\LineSpace}{\LineSpace}}{\pgfqpoint{\LineSpace}{\LineSpace}}% {     \pgfsetlinewidth{0.4pt}     \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}     \pgfpathlineto{\pgfqpoint{\LineSpace + 0.1pt}{\LineSpace + 0.1pt}}     \pgfusepath{stroke} }  \newdimen\LineSpace \tikzset{     line space/.code={\LineSpace=#1},     line space=3pt }   \begin{document} \begin{tikzpicture}     \begin{axis}[         ymin=0, ymax=1,         xmin=-1, xmax=1]                  \addplot[             pattern=my north east lines,             line space=8pt,             pattern color=green,             draw=black]              {x} \closedcycle;                 \addplot[             pattern=north east lines,             pattern color=red,             draw=black]             {-x} \closedcycle;     \end{axis}     \end{tikzpicture} \end{document}


I'm a medical student who is looking to submit images to shutterstock and hopefully pay down a little bit of debt. I have my own website but I'm having a hard time finding anyone online to review my images ( I need to pick 10). Thanks for the advice.

Whats the best what to get constructive critique of your photographs?  I'm thinking along what site or online community provides such things, but I'm open to all answers.    If I have a photograph that I think is nice, what's an effective way to get somebody (apart from friends and family) to offer "good" advice?  Posting it to a site like this one with a general "what can I do better?" isn't helpful, and on sites like Flickr only the photographs that are already good get noticed.


I want to check if an element is visible and if yes, I want to scroll down to it. I am trying to achieve that with the following jquery:  var j = jQuery.noConflict();    jQuery(document).ready(function($) {     if(j('#element').css('display') == 'block'){         j('body').scrollTo('#target');       }; });   but it does not work.

Is it possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle()?  How would you test if an element is visible or hidden?


I'm a little confused about the precision of The Dart 'double' type, for example, void main() {   double num1 = 0.55 * 10;  // 5.5   double num2 = 0.55 * 100;  // 55.00000000000001   double num3 = 0.55 * 1000; // 550   double num4 = 0.45 * 100;  // 45   print("num1: $num1, num2: $num2, num3: $num3, num4: $num4"); }  the print is: num1: 5.5, num2: 55.00000000000001, num3: 550, num4: 45  just num2's precision is exceptional. I don't know why. Can anyone help me with that? Thank you very much ^_^

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


A family has two children. What is the probability that both the children are boys given that at least on of them is a boy?  Solution given in my book is    My doubts and my solution  If a family has a child and you are required to find that what is the probability of it to be a boy then your answer will be 1/2.  Now in the present problem it is given that out of two children one is a boy then what is the probability that both are boys.  One child is boy the second child can be a boy or a girl, chance of boy is 1/2.  $P(boy|boy)=\frac{1}{2}$  What I mean is that there are two possible outcomes after we have a boy, it can be a boy or a girl out of this boy is a favorable outcome and so we have 1/2.  Request  Please don't mark this problem as duplicate of  or of  because my logics are different.

In a family with two children, what are the chances, if one of the children is a girl, that both children are girls?  I just dipped into a book, The Drunkard's Walk - How Randomness Rules Our Lives, by Leonard Mlodinow, Vintage Books, 2008. On p.107 Mlodinow says the chances are 1 in 3.   It seems obvious to me that the chances are 1 in 2. Am I correct? Is this not exactly analogous to having a bowl with an infinite number of marbles, half black and half red? Without looking I draw out a black marble. The probability of the second marble I draw being black is 1/2.